OT: Valid filenames on operating systems

B

Bruce Lee

Windows doesn't allow filename's containing the following characters:
\/:*?"<>|

Is this the same on all operating systems?

I'm asking because I'm writing a html parser which needs to find valid urls.

Thanks
 
J

Joona I Palaste

Bruce Lee said:
Windows doesn't allow filename's containing the following characters:
\/:*?"<>|
Is this the same on all operating systems?
I'm asking because I'm writing a html parser which needs to find valid urls.

No. AmigaOS only disallows : and /. Unix only disallows /, although with
clever trickery - in practice accessing the file system's name table
directly - it's possible to use even / in filenames. You won't be able
to access that file from the command line, though.
 
B

Bruce Lee

Joona I Palaste said:
urls.

No. AmigaOS only disallows : and /. Unix only disallows /, although with
clever trickery - in practice accessing the file system's name table
directly - it's possible to use even / in filenames. You won't be able
to access that file from the command line, though.

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"Normal is what everyone else is, and you're not."
- Dr. Tolian Soran

Cheers Joona
 
A

Ann

Let us know how you handle the space character.
(How do you tell the end of the filename.)
 
T

Thomas G. Marshall

Ann coughed up:
Let us know how you handle the space character.
(How do you tell the end of the filename.)

If it's a string, presumably then it's the end of the string.

I'm not sure what you're asking/implying.....Unix can clearly use the space
character. From a shell, you just have to be crafty. But within an app?
You can do "anything"....
 
J

Joona I Palaste

Thomas G. Marshall said:
Ann coughed up:

Putting the filename in double quotes "" works for both AmigaOS and
Unix. If the filename itself contains double quotes, you have to
escape them. The escape character is * for AmigaOS and \ for Unix.
Escaping the escape character itself is done by doubling it.
 
D

Dimitri Maziuk

Ann sez:
Let us know how you handle the space character.
(How do you tell the end of the filename.)

The easiest way is to never ever use spaces in the filenames
& to use underscore instead.

HTH
Dima
 
A

Ann

Thomas G. Marshall said:
Ann coughed up:

If it's a string, presumably then it's the end of the string.

I'm not sure what you're asking/implying.....Unix can clearly use the space
character. From a shell, you just have to be crafty. But within an app?
You can do "anything"....

Oh, ok. I thought the OP was "writing a html parser which needs to find
valid urls."
So you are saying that the url being questioned is available as a string.
Existing methods should do the trick then.
 
T

Thomas G. Marshall

Joona I Palaste coughed up:
Thomas G. Marshall


Putting the filename in double quotes "" works for both AmigaOS and
Unix. If the filename itself contains double quotes, you have to
escape them. The escape character is * for AmigaOS and \ for Unix.
Escaping the escape character itself is done by doubling it.


You replied to me, when you meant Ann I think.
 
J

Joona I Palaste

Thomas G. Marshall said:
Joona I Palaste coughed up:
You replied to me, when you meant Ann I think.

I have Ann killfiled because of either a mistake or some past behaviour
on her part, so I had to piggyback on your reply.

--
/-- Joona Palaste ([email protected]) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"You can pick your friends, you can pick your nose, but you can't pick your
relatives."
- MAD Magazine
 
C

Chris Uppal

Bruce said:
Windows doesn't allow filename's containing the following characters:
\/:*?"<>|

Is this the same on all operating systems?

I'm asking because I'm writing a html parser which needs to find valid
urls.

You've had lots of answers to your question, but no one (that I've seen) has
pointed out that there is exactly zero connection between what's valid in an
URL and what's valid in a filename (no matter what the OS).

The "path" bit of an URL is only a string of characters (with some encoding),
the interpretations of those characters (once decoded) is /entirely/ up to the
software that, um, interprets it.

-- chris
 
T

Thomas G. Marshall

Chris Uppal coughed up:
You've had lots of answers to your question, but no one (that I've
seen) has pointed out that there is exactly zero connection between
what's valid in an URL and what's valid in a filename (no matter what
the OS).

The "path" bit of an URL is only a string of characters (with some
encoding), the interpretations of those characters (once decoded) is
/entirely/ up to the software that, um, interprets it.

-- chris

You're right, but given the context of the question, IMHO, that seemed like
a given. Regardless of /how/ it was encoded, I think she was trying to
ascertain if the url, (http://C:\mumble) for example or similar, actually
/could/ point to a valid file. As she was originally pondering, would
screening out "?" be ok for all platforms, for example.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top