making a valid file name...

Neil Cerutti horpner at yahoo.com
Tue Oct 17 16:10:48 EDT 2006


On 2006-10-17, Edgar Matzinger <edgar at edgar-matzinger.nl> wrote:
> Hi,
>
> On 10/17/2006 06:22:45 PM, SpreadTooThin wrote:
>> valid =
>> ':./,^0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ '
>> 
>
> not specifying the OS platform, these are not all the
> characters that may occur in a filename: '[]{}-=", etc. And '/'
> is NOT valid.  On a unix platform. And it should be easy to
> scan the filename and check every character against the
> 'valid-string'.

In the interactive fiction world where I come from, a portable
filename is only 8 chars long and matches the regex
[A-Z][A-Z0-9]*, i.e., capital letters and numbers, with no
extension. That way it'll work on old DOS machines and on
Risc-OS. Wait... is there Python for Risc-OS?


-- 
Neil Cerutti

>
> HTH, cu l8r, Edgar.



More information about the Python-list mailing list