>does the sys(3) function always return a legal filename with a length of 8 characters or can it return fewer than 8?
I think I read somewhere that, depending on the exact date, it can return a name that starts with a digit, making it unsuitable for some purposes.
You might consider sys(2015) as an alternative. That one returns 10 characters, but I am not so sure about whether it may start with digits, or not. I think it is safer in the sense that sys(3) might return the same name twice, if it is called in rapid succession (twice in the same milisecond or so).
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)