Re: Valid characters for filenames. List available?

From: Date: Tue, 26 Feb 2002 22:51:00 +0000
Subject: Re: Valid characters for filenames. List available?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-86327@lists.php.net to get a copy of this message
Thanx Eric! Andy "Erik Price" <pricee@hhbrown.com> schrieb im Newsbeitrag news:9118FCB8-2AEE-11D6-88D4-0050E4857868@hhbrown.com... > > On Tuesday, February 26, 2002, at 01:34 PM, Chris Hewitt wrote: > > >> I am wondering if there is anywhere a list of characters which are not > >> allowed in a unix file name. > >> > >> I gues somethin like ' or \ is not allowed, but what else? > > My old "Teach Yourself Unix" book makes it: > > !@#$%^&()[]'"?\|;<>`+- space tab backspace > > though it says technically some could be used but might cause problems. > > As a general rule, filenames should only ever be composed of the > following characters: > > letters (A-Z and a-z) > numbers (0-9) > underscorese (_) > hyphens (-) > dots (.) > > Surely there will be some disagreement with this, but it's our policy > where I work to make certain that filenames can only be composed of > these characters. I even have the CMS I'm designing set so that > nonconformant filenames are not allowed, with a message explaining why. > The characters to be especially careful to avoid are: > > forward-slashes (/) > backslashes (\) > quotes (') > doublequotes (") > colons (:) > spaces ( ) > > The slashes are usually filesystem hierarchic delimiters on Windows and > Unix, as is the colon on pre-OS 9 Mac filesystems. Quotes and > doublequotes are usually used to escape command line strings, so they > can cause confusion (note that this includes singlequotes used as > apostrophes, like "John'spicture.jpg"). It's not that you can't use > quotes, but it forces the person manipulating them to be very careful > about how they refer to the filename. Likewise, spaces need to be > escaped, so they're a bad idea. > > This is just my opinion, but I'm sure others will agree. > > Erik > > > > ---- > > Erik Price > Web Developer Temp > Media Lab, H.H. Brown > pricee@hhbrown.com >

« previous php.general (#86327) next »