Ask a Question related to PERL Modules, Design and Development.
-
Jim Keenan #1
Characters Forbidden in File Names
For the purpose of enabling a Perl module, currently in development, to
function properly on the most common operating systems, can anyone provide a
link to a definitive list of:
1. Which characters are forbidden in filenames on Windows, *nix and Mac OS?
2. Which of these operating systems have limitations on the length of
filenames?
I ask these questions because my module creates plain-text files named
according to content extracted from the subject lines of e-mail. Such
subject lines may contain either too many characters for a particular OS or
characters forbidden in filenames on that OS.
Thanks in advance.
Jim Keenan
Jim Keenan Guest
-
#13961 [Ver->Bgs]: some characters in server variable names are silently changed
ID: 13961 Updated by: iliaa@php.net Reported By: lampa at fee dot vutbr dot cz -Status: Verified +Status: ... -
#13961 [NoF->Opn]: some characters in server variable names are silently changed
ID: 13961 User updated by: lampa at fee dot vutbr dot cz -Summary: some characters in incomonig variable names are... -
#19404 [Com]: Post variable names stripped of first 4 characters
ID: 19404 Comment by: dbradfor at nwlink dot com Reported By: mv02 at gmx dot de Status: Closed Bug Type: ... -
#13961 [Com]: some characters in incomonig variable names are silently changed
ID: 13961 Comment by: daniele at orlandi dot com Reported By: lampa at fee dot vutbr dot cz Status: No Feedback... -
#19404 [Csd]: Post variable names stripped of first 4 characters
ID: 19404 Updated by: helly@php.net Reported By: mv02 at gmx dot de Status: Closed Bug Type: mbstring... -
Kevin Michael Vail #2
Re: Characters Forbidden in File Names
In article <N6YTb.13593$KV5.251@nwrdny01.gnilink.net>,
"Jim Keenan" <no_spam_for_jkeen@verizon.net> wrote:
Unix allows filenames to contain any character except /, which is used> For the purpose of enabling a Perl module, currently in development, to
> function properly on the most common operating systems, can anyone provide a
> link to a definitive list of:
>
> 1. Which characters are forbidden in filenames on Windows, *nix and Mac OS?
>
> 2. Which of these operating systems have limitations on the length of
> filenames?
as a directory separator. However, some characters can be problematic
in different ways. I think filenames are limited to 255 characters.
I don't remember exactly which characters aren't allowed in Windows
filenames, but definitely / \ * ? and I think < >. I think the max
length is 255 there, too.
Classic MacOS allows filenames to have any character except : (which
functions roughly as / does in Unix) and limits filenames to 31
characters.
Mac OSX supports filenames with up to 255 Unicode characters, but no
slashes (it's Unix underneath).
You would probably be better off restricting yourself to a "least common> I ask these questions because my module creates plain-text files named
> according to content extracted from the subject lines of e-mail. Such
> subject lines may contain either too many characters for a particular OS or
> characters forbidden in filenames on that OS.
denominator" of characters known to be valid in all three OSes,
something like letters, digits, certain punctuation such as periods,
commas, dashes, etc.
--
Found Poetry (_Science News_, 14-Jun-2003): oldest _homo sapiens_ find
+-----------------------------------------+ ocean eddies' far-flung effects;
| Kevin Michael Vail <kevin@vaildc.net> | superior threads spun
+-----------------------------------------+ the pox from prairie dogs.
Kevin Michael Vail Guest
-
Philip Newton #3
Re: Characters Forbidden in File Names
On Tue, 03 Feb 2004 23:27:19 -0500, Kevin Michael Vail
<kevin@vaildc.net> wrote:
Some very old versions have a 14-character limit.> Unix allows filenames to contain any character except /, which is
> used as a directory separator. However, some characters can be
> problematic in different ways. I think filenames are limited to 255
> characters.
Do you also want to include VMS and DOS? What about ISO9660> You would probably be better off restricting yourself to a "least
> common denominator" of characters known to be valid in all three
> OSes,
--> something like letters, digits, certain punctuation such as periods,
> commas, dashes, etc.
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
Philip Newton Guest
-
Philip Newton #4
Re: Characters Forbidden in File Names
On Tue, 03 Feb 2004 23:27:19 -0500, Kevin Michael Vail
<kevin@vaildc.net> wrote:
Some very old versions have a 14-character limit.> Unix allows filenames to contain any character except /, which is
> used as a directory separator. However, some characters can be
> problematic in different ways. I think filenames are limited to 255
> characters.
Do you also want to include VMS and DOS? What about ISO9660 CD file> You would probably be better off restricting yourself to a "least
> common denominator" of characters known to be valid in all three
> OSes,
system?
I think the latter is the most restrictive; IIRC up to eight uppercase
letters or digits (maybe underscores), optionally followed by one dot
and up to three more letters or digits. I believe there are also
limitations on the depth of nested directories.
DOS itself is only slightly less restricted - also "8.3" but with more
allowed characters.
For maximum compatibility, not more than one period.> something like letters, digits, certain punctuation such as periods,
> commas, dashes, etc.
Cheers,
Philip
--
Philip Newton <nospam.newton@gmx.li>
That really is my address; no need to remove anything to reply.
If you're not part of the solution, you're part of the precipitate.
Philip Newton Guest



Reply With Quote

