Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: regex needed with match operator (forbidden chars in filenames)

by Aristotle (Chancellor)
on Apr 28, 2003 at 18:57 UTC ( #253790=note: print w/replies, xml ) Need Help??


in reply to Re: Re: regex needed with match operator
in thread regex needed with match operator

In fact, the null byte is the only character you can expect not to show up in file names; on Unixoid and DOSish systems, the slash is also guaranteed not to appear, unless maybe you're working with a shot filesystem (I don't think we need to discuss that case). DOSish systems impose a whole lot of additional restrictions of course; none of those exist on Unixoid systems. On other systems than those, all bets are off; I wouldn't be surprised if the slash was a valid part of filenames on something "weird" like VMS.

Makeshifts last the longest.

  • Comment on Re^3: regex needed with match operator (forbidden chars in filenames)

Replies are listed 'Best First'.
Re: Re^3: regex needed with match operator
by diotalevi (Canon) on Apr 28, 2003 at 19:14 UTC

    By "slash", I think you meant only forward-slash '/' since '\' is legal for my UFS (OpenBSD) file system and I recall that its fine for Linux (when I last used it eons ago). Both '/' and '\' are illegal for the various Microsoft filesystems. Both '/' and '\' are legal in the Mac file systems except there ':' is reserved. *grin* aint it fun? I just use File::Spec and hope for the best.

      Yes, I meant forward slash, which is what slash usually means - the other one is called backslash, after all. And yes, I knew the colon is reserved on Mac (as it is on DOSish systems, btw), though I wasn't sure about the slash being legal. At any rate, yeah, that was my point. You can only rely on the nullbyte being illegal.. on most systems that commonly run Perl the slash is also, but even that's already not fully portable anymore.

      The only thing I hate about File::Spec is its (IMHO) misguided attempt to reduce namespace clutter and forcing a lot of typing on the user instead. Of course there's File::Spec::Functions.. what a mess. </rant>

      Makeshifts last the longest.

Re: Re^3: regex needed with match operator
by pfaut (Priest) on Apr 28, 2003 at 20:33 UTC
    On other systems than those, all bets are off; I wouldn't be surprised if the slash was a valid part of filenames on something "weird" like VMS.

    Nope. VMS is very strict unless things changed in ODS-5 (I haven't worked with V7). ODS-2 only allows upper case alpha, numeric, dollar sign, underscore and hyphen. Slashes in either direction are definitely out. Filenames can have a 39 character name and a 39 character type separated by a period. Older versions of VMS only allowed 9.3 filenames.

    90% of every Perl application is already written.
    dragonchild

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://253790]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2021-04-11 16:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?