Re: Making a string, file-safe (file-encode??)
- From: Daniel Pitts <newsgroup.spamfilter@xxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Jun 2008 13:57:55 -0700
adamorn@xxxxxxxxx wrote:
On Jun 17, 3:13 pm, Daniel PittsThen make sure the variable is being set by something that doesn't add invalid characters. Details might help us better help you.
<newsgroup.spamfil...@xxxxxxxxxxxxxxxxxxx> wrote:
adam...@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
a safe.
What I mean is that if I am creating afilefrom a string variable, I
want to ensure that thefilewill 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 URLencodethat encodes strings
for use in urls, but is there another function that works similarly
for strings for files that I want to create?
Thanks!
characters that are invalid are system specific, and some systems don't
have limitations at all.
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/>
ah, but Im actually pulling the filename from a variable that the user
does not set...
--
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
.
- References:
- Making a string, file-safe (file-encode??)
- From: adamorn
- Re: Making a string, file-safe (file-encode??)
- From: Daniel Pitts
- Re: Making a string, file-safe (file-encode??)
- From: adamorn
- Making a string, file-safe (file-encode??)
- Prev by Date: Re: Umm odd behaviour !!
- Next by Date: Re: Umm odd behaviour !!
- Previous by thread: Re: Making a string, file-safe (file-encode??)
- Next by thread: Re: Making a string, file-safe (file-encode??)
- Index(es):
Relevant Pages
|