>> Perl 5 runs on (at least) VMS and VOS too. So, if Perl 6 is to adopt a policy
>> of enforced portable filenames by default, it should (at least) also exclude
>> - as the first character, and forbid more than one . in a filename.
>
> And, as I mentioned in an earlier post during the discussion, the
> restrictions for Windows are numerous:
>
> http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx
>
> Enforcing truly "portable" filenames is unrealistic, I think, but
> having a POSIX-checking default is a good thing.

My idea with portable by default was only portability for modern Unix and
modern Windows. So DOS and VMS limitations would not apply. The problem of
enforcing truly "portable" filenames is that the files names get too
restrictive and for most applications targeting 98% of systems out there would
be enough.

With modern Unix/Windows I'm thinking about systems that support and use UCS2
or UTF8 and where "." or other common characters does not have special meaning
for the filesystem.

Using POSIX as the basis would properly not be enough as it's either to lax or
to strict.

I think Windows NTFS/VFAT32 + Kernel limits on characters might be a good basis:

http://en.wikipedia.org/wiki/Filename

 * So paths can be up to 259 characters long
 * No characters in the range 0x01-0x1F
 * No control characters
 * Non of the following characters: " * : < > ? \ / |.
 * Directory or filename up to 255 characters long
 * Only Unicode that fits in UCS-2(the 16bit subset)

Any system specific restrictions would not apply like AUX, CLOCK$, COM, etc.
would not apply and the programmer would be allow to shoot him/herself in the
foot.

Besides that, a simple check on Unix for what the locale is set to might also be
nice, so we don't write UTF8 files on a filesystem where the rest for the files
are in Latin1.

Regards Troels.

Reply via email to