Re: Making a string, file-safe (file-encode??)
- From: Daniel Pitts <newsgroup.spamfilter@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Jun 2008 12:13:03 -0700
adamorn@xxxxxxxxx wrote:
I was wondering if there was a quick way to ensure that a filename is? is not invalid on all system, linux handles it perfectly. The characters that are invalid are system specific, and some systems don't have limitations at all.
a safe.
What I mean is that if I am creating a file from a string variable, I
want to ensure that the file will actually be able to be created. So
if it contains a "?", then clearly I would want to eliminate it.
I know that there is something like URL encode that encodes strings
for use in urls, but is there another function that works similarly
for strings for files that I want to create?
Thanks!
The only portable way to handle this is to catch exceptions and report them to the user.
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
.
- Follow-Ups:
- Re: Making a string, file-safe (file-encode??)
- From: Tim Smith
- Re: Making a string, file-safe (file-encode??)
- From: adamorn
- Re: Making a string, file-safe (file-encode??)
- References:
- Making a string, file-safe (file-encode??)
- From: adamorn
- Making a string, file-safe (file-encode??)
- Prev by Date: Making a string, file-safe (file-encode??)
- Next by Date: Re: Training on java
- Previous by thread: Making a string, file-safe (file-encode??)
- Next by thread: Re: Making a string, file-safe (file-encode??)
- Index(es):
Relevant Pages
|