How to check if a path *could* be a legal path?
From: Maciej Sobczak (no.spam_at_no.spam.com)
Date: 04/20/04
- Next message: srijit_at_yahoo.com: "Re: Dollar sign ($) on foriegn keyboards? (prothon)"
- Previous message: Nick Efford: "Re: block ciphers"
- Next in thread: Larry Bates: "Re: How to check if a path *could* be a legal path?"
- Reply: Larry Bates: "Re: How to check if a path *could* be a legal path?"
- Reply: Peter Hansen: "Re: How to check if a path *could* be a legal path?"
- Reply: Gerrit: "Re: How to check if a path *could* be a legal path?"
- Reply: Gabriel Cooper: "Re: How to check if a path *could* be a legal path?"
- Reply: Bill Rubenstein: "Re: How to check if a path *could* be a legal path?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 20 Apr 2004 12:40:04 +0200
Hi,
I have a string.
This string is to be used as a path for a new file.
I would like to check if this string *could be* a valid file name,
*before* I try to create the file itself.
In other words, I would like to know whether some string violates the
underlying OS's policies (or maybe some more restriced policies, but
portable) considering file paths.
Example:
1.
s = 'C:\file.txt'
the above is potentially a valid path on my system.
2.
s = 'cc:/^- =#jk\kj+.+?! :-)'
the above is rather invalid and I would like to check it somehow before
I even try to create the file.
Does the Python library contain a functionality that allows to achieve
this goal?
-- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/
- Next message: srijit_at_yahoo.com: "Re: Dollar sign ($) on foriegn keyboards? (prothon)"
- Previous message: Nick Efford: "Re: block ciphers"
- Next in thread: Larry Bates: "Re: How to check if a path *could* be a legal path?"
- Reply: Larry Bates: "Re: How to check if a path *could* be a legal path?"
- Reply: Peter Hansen: "Re: How to check if a path *could* be a legal path?"
- Reply: Gerrit: "Re: How to check if a path *could* be a legal path?"
- Reply: Gabriel Cooper: "Re: How to check if a path *could* be a legal path?"
- Reply: Bill Rubenstein: "Re: How to check if a path *could* be a legal path?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
Loading