On Tue, Aug 18, 2009 at 10:36:45AM +0200, Jan Ingvoldstad wrote:
> On Tue, Aug 18, 2009 at 10:01 AM, Nicholas Clark<n...@ccl4.org> wrote:
> > On Tue, Aug 18, 2009 at 09:24:08AM +0200, pugs-comm...@feather.perl6.nl 
> > wrote:
> >
> >> +=head3 Default constraints
> >> +
> >> +The default p{} only allows "/" as separator and does not allow path 
> >> elements
> >> +to contain
> >> +characters that won't work on modern Windows and Unix like \ / ? % * : | 
> >> " > <,
> >> +etc. The reason for this is that portable paths are the default. If
> >> +platform/filesystem specific behavior is really needed it should be shown 
> >> in
> >> +the code by applying different sets of constraints (see below).
> >
> > 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

Oh gosh yes. I forgot. AUX.TXT
And all the the other CP/M device file names, with our without extensions...


[And of course, IIRC, DOS filenames can't be more than 64 characters. Which
means that your code thinks that it knows what it's doing by stripping of
the drive letter and allowing 62 in the rest of the pathname. Except that
I remember university servers with drives UX: and UY:, which always made me
wonder if there was a buffer overflow waiting to happen...]

> Enforcing truly "portable" filenames is unrealistic, I think, but
> having a POSIX-checking default is a good thing.

What does POSIX enforce? ASCII NUL terminated, multiple adjacent / characters
fold to 1, except at the start, where // is special, but /// etc aren't?
And anything else goes?

Nicholas Clark

Reply via email to