allowed characters in paths and file names 
Author Message
 allowed characters in paths and file names

Is there a good document around that lists in one place
all the different character and length restrictions on directory paths
and file names and URLs etc, for all the different operating systems
and other standards?

And are there preferred or common ways to transliterating one to another?
E.g. it's sometimes convenient to transliterate a path "a/b/c.ext"  to a name
"a_b_c.ext", except that '/' should probably go to some other character,
say ' '. ... etc.

~greg



Thu, 12 Aug 2004 18:35:25 GMT  
 allowed characters in paths and file names

Quote:

>Is there a good document around that lists in one place
>all the different character and length restrictions on directory paths
>and file names and URLs etc, for all the different operating systems
>and other standards?

What is your Perl question?

--
    Tad McClellan                          SGML consulting

    Fort Worth, Texas



Thu, 12 Aug 2004 19:22:11 GMT  
 allowed characters in paths and file names

Quote:


> >Is there a good document around that lists in one place
> >all the different character and length restrictions on directory paths
> >and file names and URLs etc, for all the different operating systems
> >and other standards?

> What is your Perl question?

I've very sorry, Mr Tad.
Ok.
How about:        Is there a perl module that does these transliterations?
Except that'd had better go to comp.lang.perl.modules.

So how about:    Is there a Perl script that does these transliterations?

~

You really need to see the key words, don't you?
Can't figure them out yourself.

Mr Tad, I've just reviewed several of your posts on Google.
And there are very many there, so it's not as if you don't have
any time try to be helpful to others. So why is it that so many of
your responses are like this one - with no positive content whatever,
only picayune anal-retentive points of order?  

I do see your point in several of them, but I wasn't cross-posing,  
or asking a question that should obviously have been directed  
to some other particular group (- or which one should it be?
-- I use Perl, - so I asked here). And I asked a question that's
obviously to do with text manipulation, and the question wasn't
long or confused, and I haven't asked it before.

So perhaps you might ask yourself if maybe you aren't getting
a little old and stiff in this knee-jerk habit of yours (you took all
of one minute to "respond" to my question), and maybe should
try a little to differentiate truly egregious from normal everyday
informal, and friendly, - *ALT* usenet usage.

thank you for having taking the time to read this.

~greg

Quote:
> --
>     Tad McClellan                          SGML consulting

>     Fort Worth, Texas



Thu, 12 Aug 2004 20:39:15 GMT  
 allowed characters in paths and file names

Quote:



>> >Is there a good document around that lists in one place
>> >all the different character and length restrictions on directory paths
>> >and file names and URLs etc, for all the different operating systems
>> >and other standards?

>> What is your Perl question?

> I've very sorry, Mr Tad.
> Ok.
> How about:        Is there a perl module that does these transliterations?

This was not your question.

Quote:
> Except that'd had better go to comp.lang.perl.modules.

> So how about:    Is there a Perl script that does these transliterations?

This was not your question.

Moreover, irrelevant. Whether such a script exists somewhere in this world is
something hardly anyone will be interested in in this group. Try using a
search-engine instead. This is a technical newsgroup about the language
Perl.

[snipped usual lamento]

Tassilo
--

pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
$_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;



Thu, 12 Aug 2004 20:50:48 GMT  
 allowed characters in paths and file names


Quote:



> >> >Is there a good document around that lists in one place
> >> >all the different character and length restrictions on directory paths
> >> >and file names and URLs etc, for all the different operating systems
> >> >and other standards?

> >> What is your Perl question?

> > I've very sorry, Mr Tad.
> > Ok.
> > How about:        Is there a perl module that does these transliterations?

> This was not your question.

> > Except that'd had better go to comp.lang.perl.modules.

> > So how about:    Is there a Perl script that does these transliterations?

> This was not your question.

~~
You do this all the time don't you?
That's why you're good at taking things out of context.

I didn't say that was my question.
I said, in the very next sentence, which you cut,
that if you weren't such a automaton then you would have
simply reformulated what I asked in whatever trivially equivalent
question-format you felt more comfortable with, and for which you
just might have something useful to say, perhaps something
like an answer if you wanted to be useful. Or did I say it too harshly  
that you had to censor it?  I said:

     > > You really need to see the key words, don't you?
     > > Can't figure them out yourself.

And when you respond (twice)

    > This was not your question.

you just prove it.

Quote:
> Moreover, irrelevant.
> Whether such a script exists somewhere in this world is
> something hardly anyone will be interested in in this group.

~~
".. hardly anyone will be interested..." you say?

Well I obviously am.

And you two obviously aren't.

So what?  

You two have appointed yourselves the moderators
of an unmoderated group?
Well that's typical.

Unfortunately the Taliban have broken up
or could have find happiness with them.

Quote:
> Try using a
> search-engine instead.

~~
Easy.

I asked, as one possible response, for a link to a
*good* document that had *all* of what I was looking
for in *one* place. *Good* is one of the key words
in that.  It means *a link to a document read and evaluated
and judged to be good by someone who knows - not
hundreds links to pieces buried in the billions of things that
happen to be indexed by altavista as obtained by a search*.
And obviously from the way I asked it you knew that
I'd already searched and found many documents
that had *some* of what I was looking for,  but none that
were comprehensive. And obviously  "hardly anyone" reading
this ng  hasn't had to deal with this issue at sometime
or other, and therefore someone here, obviously neither
of you two,  would very like know *something* useful
about it, either straight info or a *good* link.

Quote:
> This is a technical newsgroup about the language Perl.

~~
Then you must change it's name to  

       alt.lang.perl.technical

or whatever you like
because

    alt.lang.perl.misc

has that little abbreviation

       "misc",

in it, - which stands for

      "miscellaneous"

- and does not stand for, for example:

      "syntax and semantics question only",  

or whatever it is you mean by "technical".

(AND DO NOT direct me to the FAQs!

But  see that there have been CGI questions here.
Those are application or module questions -not
syntax and semantic - so you must tell them
to cut it out.
.

Quote:
> [snipped usual lamento]

> Tassilo
> --

> pam{rekcahbus;})(rekcah{lrePbus;})(lreP{rehtonabus;})(rehtona{tsuJbus!;
> $_=reverse;s/sub/(reverse"bus").chr(32)/xge;tr~\n~~d;eval;

Very cute.

And what grade are you in?



Thu, 12 Aug 2004 22:37:06 GMT  
 allowed characters in paths and file names

Quote:


> >Is there a good document around that lists in one place
> >all the different character and length restrictions on directory paths
> >and file names and URLs etc, for all the different operating systems
> >and other standards?

> What is your Perl question?

Greg - The short answer is "No", and the slightly longer answer is
to check the friendly manual for the OS or application you are using.
What is correct in one situation may be wrong in another. I know
that that is not a very satisfying answer, but your simple question
exposes the underbelly of a {*filter*} problem involving cross-platform,
cross-OS and cross-application object naming conventions. The world
is not just one big homogeous address space!

<rant>

Why is it so hard to give people short answers to questions that
are not strictly about perl?

Yes, Greg did not phrase his question so that it directly, and
only, pertained to things perlish, but I can see how he might
have first thought about this question while dealing with a perl
program.  For example, there was a thread just a few days ago
where a perl newbie was on a windows machine and put a windows
path (using backslashes) in single quotes.  Unfortunately for
him, he used a backslash as the last character of the path,
thereby escaping the ending quote and .... you get the idea.

Now let's say that Greg was reading this earlier post and it
occurred to him that "Hey! Maybe not every character is legal
in a path name!  What a concept!  I wonder what is legal?
I'll bet those smart dewds on clpm know!"

OK, so maybe he should have thought for 10msec and added 'in perl'.
But how much time did Tad (and many others in many other
threads) spend to basically tell him to get lost?  If he wanted
to still be rude, but helpful, Tad could have just said "No"
and left it at that. (Tad, I'm not singling you out, even though
it looks like it.  I'm just so tired of the time wasted
on non-answers.  If the question *might* be interpreted as
meaningful in a perl sense, why not try to answer it?  Hell!
You might find out that it is not such a simple question after all.)

The fact of the matter is, filenames, URLs, etc., are somewhat
tricky.  And the way they are treated in perl (particularly
in strings when throwing in any non-UNIX(tm) characters like
'%20' or 'c:\' or '$SYS') is not always immediately obvious
to a newbie.  So maybe Greg was asking a perl question but
committed the unpardonable crime of not using the word "perl"
in his question.  Let's see if his question makes sense by
just adding a word or two:

    Is there a good document around that lists in one place all
    the different character and length restrictions on directory
    paths and file names and URLs etc, for all the different
    operating systems and other standards with regards to perl?
                                          ^^^^^^^^^^^^^^^^^^^^

Oooooh!  Good question!  I suppose you could just say RTFM,
but just where in the FM would you look to answer this
question?  Now I suppose it's because I'm blind, or an idiot,
or something, but I looked, I mean I *really* looked in the
docs and I couldn't find anything that addressed this fairly
important issue.

I am pretty sure it's in there somewhere, but where?  Mind you,
I didn't just thumb through a couple of pages and give up.
I spent about 15 minutes using my own search-the-documentation
tool, going through perlopentut, perlos2, and all manner of
other stuff and I could not find this information.

The only thing that came close to addressing this was in perlfaq5,
   "Why can't I use ``C:\temp\foo'' in DOS paths? What doesn't
    `C:\temp\foo.exe` work?"
but it doesn't really deal with the subject of "legal
filenames", it just says you can get away with forward slashes
so use those instead.

So what is the answer to Greg's question?  "No" works, but that
might just be a substitute for "I don't know!".

   "Whether such a script exists somewhere in this world is
   something hardly anyone will be interested in in this group."

Tassilo?, although you were also quick to not answer his
question, how many different OSes (I mean really different: VMS,
OS2, WinXX, etc. (not to mention all of the different Unicies:
Linux*, AIX, HPUX, AUX, Solaris, Xenix (gack), *BSD, etc. etc.)
have you had to port a perl app to?  NewsFlash: They ain't all the
same! Maybe your response applies to your world view, but I'll
thank you to not speak for me or the other poor schmucks who
have to deal with all manner of evil legacy systems.
(Now *there's* an Axis of Evil for you!)

</rant>

Whew! I feel much better now!

  Peter Rowell

You do not really understand something unless
you can explain it to your grandmother.
        -- Albert E.



Thu, 12 Aug 2004 22:36:48 GMT  
 allowed characters in paths and file names

Quote:



>> >Is there a good document around that lists in one place
>> >all the different character and length restrictions on directory paths
>> >and file names and URLs etc, for all the different operating systems
>> >and other standards?

>> What is your Perl question?

>I've very sorry, Mr Tad.

I'm afraid I doubt your sincerity there.

Quote:
>How about:        Is there a perl module that does these transliterations?
>Except that'd had better go to comp.lang.perl.modules.

>So how about:    Is there a Perl script that does these transliterations?

You did not ask those.

I commented on what is quoted above. It is Perl-free.

Quote:
>You really need to see the key words, don't you?

I do not need to see anymore of your posts at all. I've seen enough.

Quote:
>And there are very many there, so it's not as if you don't have
>any time try to be helpful to others.

                            ^^^^^^^^^

I have taken steps to ensure the applicability of that part.

Quote:
>So perhaps you might ask yourself if maybe you aren't getting
>a little old and stiff in this knee-jerk habit of yours

I already know that.

What is your point?

Quote:
>(you took all
>of one minute to "respond" to my question),

What does time have to do with anything?

It took me less than one minute to discern that there was no
Perl aspect to your question.

Quote:
>and maybe should
>try a little to differentiate truly egregious from normal everyday
>informal, and friendly, - *ALT* usenet usage.

*You* posted _here_.

If you want alt.perl then you should post to alt.perl.

If I wanted alt.perl then I would be reading alt.perl.

This is not alt.perl.

Quote:
>thank you for having taking the time to read this.

Won't be happening again.

*plonk*

--
    Tad McClellan                          SGML consulting

    Fort Worth, Texas



Thu, 12 Aug 2004 22:50:25 GMT  
 allowed characters in paths and file names

Quote:

>    alt.lang.perl.misc

There is no such newsgroup.

This is a "Big Eight" newsgroup.

The alt.* wasteland is a whole different thing.

If you like that different sort of thing, then particpate there.

--
    Tad McClellan                          SGML consulting

    Fort Worth, Texas



Thu, 12 Aug 2004 22:56:00 GMT  
 allowed characters in paths and file names

Quote:


> >    alt.lang.perl.misc

> There is no such newsgroup.

Quite right.  I really didn't noticed that.

And it does make the difference.

And I do apologize now ---
- Sincerely!

~greg

Quote:

> This is a "Big Eight" newsgroup.

> The alt.* wasteland is a whole different thing.

> If you like that different sort of thing, then particpate there.

> --
>     Tad McClellan                          SGML consulting

>     Fort Worth, Texas



Thu, 12 Aug 2004 23:25:05 GMT  
 allowed characters in paths and file names

Thank you Peter.

I'll read this more carefully when I get the chance,
but already it's obvious that you clearly understand my question
and its conceivable non in-appropriateness to comp.lang.perl.misc.

I ought to say that I did encountered this problem area
many times in different contexts -- when trying to copy
folders of  HTML documents with spaghetti linking from
a Win98  file system to a CD, and when trying to up-load
things to my 'site', and when trying to mirror parts
of sites and had to decide if it was better to mirror the
file structure or else choose some arbitrary way to flatten
paths into long file names (because I won't use generated
random names)  Many times I've had to change batches of file
names in order to conform to some restriction I only found
out about by running into it.  But I did it with Perl, so it was
fun for awhile. But this is clearly a delimited and common
problem area and therefore should have its own module,
or at least some central clearing house of information about it.
I don't have to do the kinds of things you have to do, but I
do for example still have some things on CP/M that I could
use if I could find a 5-1/4"  floppy-drive, and didn't have to
worry so much about porting file names.

~greg

ps:
Grandmother thanks you too.

Quote:



> > >Is there a good document around that lists in one place
> > >all the different character and length restrictions on directory paths
> > >and file names and URLs etc, for all the different operating systems
> > >and other standards?

> > What is your Perl question?

> Greg - The short answer is "No", and the slightly longer answer is
> to check the friendly manual for the OS or application you are using.
> What is correct in one situation may be wrong in another. I know
> that that is not a very satisfying answer, but your simple question
> exposes the underbelly of a {*filter*} problem involving cross-platform,
> cross-OS and cross-application object naming conventions. The world
> is not just one big homogeous address space!

> <rant>

> Why is it so hard to give people short answers to questions that
> are not strictly about perl?

> Yes, Greg did not phrase his question so that it directly, and
> only, pertained to things perlish, but I can see how he might
> have first thought about this question while dealing with a perl
> program.  For example, there was a thread just a few days ago
> where a perl newbie was on a windows machine and put a windows
> path (using backslashes) in single quotes.  Unfortunately for
> him, he used a backslash as the last character of the path,
> thereby escaping the ending quote and .... you get the idea.

> Now let's say that Greg was reading this earlier post and it
> occurred to him that "Hey! Maybe not every character is legal
> in a path name!  What a concept!  I wonder what is legal?
> I'll bet those smart dewds on clpm know!"

> OK, so maybe he should have thought for 10msec and added 'in perl'.
> But how much time did Tad (and many others in many other
> threads) spend to basically tell him to get lost?  If he wanted
> to still be rude, but helpful, Tad could have just said "No"
> and left it at that. (Tad, I'm not singling you out, even though
> it looks like it.  I'm just so tired of the time wasted
> on non-answers.  If the question *might* be interpreted as
> meaningful in a perl sense, why not try to answer it?  Hell!
> You might find out that it is not such a simple question after all.)

> The fact of the matter is, filenames, URLs, etc., are somewhat
> tricky.  And the way they are treated in perl (particularly
> in strings when throwing in any non-UNIX(tm) characters like
> '%20' or 'c:\' or '$SYS') is not always immediately obvious
> to a newbie.  So maybe Greg was asking a perl question but
> committed the unpardonable crime of not using the word "perl"
> in his question.  Let's see if his question makes sense by
> just adding a word or two:

>     Is there a good document around that lists in one place all
>     the different character and length restrictions on directory
>     paths and file names and URLs etc, for all the different
>     operating systems and other standards with regards to perl?
>                                           ^^^^^^^^^^^^^^^^^^^^

> Oooooh!  Good question!  I suppose you could just say RTFM,
> but just where in the FM would you look to answer this
> question?  Now I suppose it's because I'm blind, or an idiot,
> or something, but I looked, I mean I *really* looked in the
> docs and I couldn't find anything that addressed this fairly
> important issue.

> I am pretty sure it's in there somewhere, but where?  Mind you,
> I didn't just thumb through a couple of pages and give up.
> I spent about 15 minutes using my own search-the-documentation
> tool, going through perlopentut, perlos2, and all manner of
> other stuff and I could not find this information.

> The only thing that came close to addressing this was in perlfaq5,
>    "Why can't I use ``C:\temp\foo'' in DOS paths? What doesn't
>     `C:\temp\foo.exe` work?"
> but it doesn't really deal with the subject of "legal
> filenames", it just says you can get away with forward slashes
> so use those instead.

> So what is the answer to Greg's question?  "No" works, but that
> might just be a substitute for "I don't know!".


>    "Whether such a script exists somewhere in this world is
>    something hardly anyone will be interested in in this group."

> Tassilo?, although you were also quick to not answer his
> question, how many different OSes (I mean really different: VMS,
> OS2, WinXX, etc. (not to mention all of the different Unicies:
> Linux*, AIX, HPUX, AUX, Solaris, Xenix (gack), *BSD, etc. etc.)
> have you had to port a perl app to?  NewsFlash: They ain't all the
> same! Maybe your response applies to your world view, but I'll
> thank you to not speak for me or the other poor schmucks who
> have to deal with all manner of evil legacy systems.
> (Now *there's* an Axis of Evil for you!)

> </rant>

> Whew! I feel much better now!

>   Peter Rowell

> You do not really understand something unless
> you can explain it to your grandmother.
>         -- Albert E.



Fri, 13 Aug 2004 00:17:34 GMT  
 allowed characters in paths and file names

Quote:
>Is there a good document around that lists in one place
>all the different character and length restrictions on directory paths
>and file names and URLs etc, for all the different operating systems
>and other standards?

I nailed some jelly to a tree yesterday, but it musta crawled off.


Fri, 13 Aug 2004 08:11:56 GMT  
 allowed characters in paths and file names

Quote:
>Unfortunately the Taliban have broken up
>or could have find happiness with them.

Can I invoke Godwin?  Or at least a Godwin corollary?

Rich
--

Technical Consultant     | I speak for me,     |   19055 Pruneridge Ave.
Development Alliances Lab|            *not* HP |                MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014



Fri, 13 Aug 2004 19:15:05 GMT  
 allowed characters in paths and file names

Quote:

> >Unfortunately the Taliban have broken up
> >or could have find happiness with them.

> Can I invoke Godwin?  Or at least a Godwin corollary?

Good point!

Important questions:
+  Has Godwin become antiquated?
+  Is Adolf such a historically distant figure that invoking
   him has lost all of its bite?
+  Is Al Quiada to the SS as Osama is to Adolf?
+  Is OBL the new boogieman?

Inquiring minds want to know!

So, Richard, you are proposing:

Rauenzahn's Corollary to Godwin's Rule of Nazi Analogies:
    As a Usenet discussion grows longer, the probability of a
    comparison involving the Taliban or Osama Bin Laden approaches one.

Hmmm... It doesn't seem to have quite the immediate sense of invoking
The Dark One that getting Adolf involved does.

  Peter

Hanlon's Razor:
  Never attribute to malice that which is adequately explained by stupidity.

Rowell's Extension of Hanlon's Razor:
  But don't forget that truly stupid people can still be malicious.



Fri, 13 Aug 2004 22:26:12 GMT  
 allowed characters in paths and file names

Quote:

> >Is there a good document around that lists in one place
> >all the different character and length restrictions on directory paths
> >and file names and URLs etc, for all the different operating systems
> >and other standards?

Well FWIW on a Mac it seems the only proscribed character is ':' - a
colon is the path separator. Directories and files may have 31
characters in their name. I don't know if there is a limit to the length
of the entire path. Volumes may have 27 characters in their name.

On unix some systems place a 255 character limit on a path - which you
can get round by splitting the path into chunks and following the chunks
one after another (maybe this is only at the OS level??). The maximum
length of a filename is given in one of the standard headers - on my
systems it happens to be in <bits/stdio_lim.h> which says:
# define FILENAME_MAX 4095
I believe that the null character is very definitely not allowed in Unix
directory entries, and pretty certain that '/' is disallowed too.

In windows (maybe only some versions of) these characters are illegal:
\ / : * ? " < > |

A URL has a syntax defined in some RFCs (google for 'uniform resource
locator rfc' and go on from there) and is really just a string, which is
the same on all OSs. What will be OS specific is the file:/ urls and any
translation from url to filesystem.
E.g. on this machine:
file://*./   -  is the local appletalk zone
file://line/System%208.6/System%20Folder/   -  is the local system folder
file:///System%208.6/System%20Folder/   -  is the same
file:///Work/slash%20%2F%20dot/   - is a folder with a '/' in its name
file:///Work:SWIGtest/ - a more normal Mac filepath

Don't forget VMS's syntax too. Restrictions on CD-ROMs may vary too.

But what's legal and what's actually sensible are 2 different things.
Also have a look at File::Basename, File::PathConvert and File::Spec

P

--
pkent 77 at yahoo dot, er... what's the last bit, oh yes, com
Remove the tea to reply



Sat, 14 Aug 2004 05:15:20 GMT  
 allowed characters in paths and file names

Quote:

> And are there preferred or common ways to transliterating one to another?

Ignoring the rant going on elsewhere, I think the module you're looking
for is File::Spec, which hides all (well, most) of this {*filter*} stuff
for you.

Chris



Sat, 14 Aug 2004 11:41:13 GMT  
 
 [ 15 post ] 

 Relevant Pages 

1. want better way to extract file name from full path file name

2. Creating a variable with a file path/name in it

3. extract dir name from file path

4. HELP: Obtaining absolute file names and paths

5. Extract file name from path

6. finding full path to file name

7. File::Path and tainted directory names.

8. Help Faking path extensions on a web server that does not allow them

9. script to replace characters in file names

10. BUG ?=>Cannot delete file with name more than 19 character

11. only allowing characters from a list to be inputed

12. Allowing escaped characters in a split

 

 
Powered by phpBB® Forum Software