By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,345 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,345 IT Pros & Developers. It's quick & easy.

File Name Format

P: n/a
Greetings,

How do I convert programmatically the file names from WIN32 to UNIX format?

A code snippet would be of great help.
We are new to python! :)

Thanks.
Best regards,
Anand
May 8 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Anand wrote:
Greetings,

How do I convert programmatically the file names from WIN32 to UNIX
format?

A code snippet would be of great help.
We are new to python! :)
unix_name = win_name.replace("\\", "/")

But this of course won't work for anything that starts with a drive letter
for example.

Diez
May 8 '07 #2

P: n/a
On 2007-05-08, Anand <an***********@in.bosch.comwrote:
How do I convert programmatically the file names from WIN32 to UNIX format?
You don't need to. AFAIK, all legal WIN32 filenames are legal
UNIX file names.
A code snippet would be of great help.
As would an example of what you're trying to do.

--
Grant Edwards grante Yow! JAPAN is a WONDERFUL
at planet -- I wonder if we'll
visi.com ever reach their level of
COMPARATIVE SHOPPING ...
May 8 '07 #3

P: n/a
In <13*************@corp.supernews.com>, Grant Edwards wrote:
On 2007-05-08, Anand <an***********@in.bosch.comwrote:
>How do I convert programmatically the file names from WIN32 to UNIX format?

You don't need to. AFAIK, all legal WIN32 filenames are legal
UNIX file names.
Doesn't this depend more on the file system than the operating system?

Ciao,
Marc 'BlackJack' Rintsch
May 8 '07 #4

P: n/a
On 2007-05-08, Marc 'BlackJack' Rintsch <bj****@gmx.netwrote:
In <13*************@corp.supernews.com>, Grant Edwards wrote:
>On 2007-05-08, Anand <an***********@in.bosch.comwrote:
>>How do I convert programmatically the file names from WIN32 to UNIX format?

You don't need to. AFAIK, all legal WIN32 filenames are legal
UNIX file names.

Doesn't this depend more on the file system than the operating system?
Sort of. AFAIK, no matter which "Windows" filesystem you pick,
the set of allowed filenames are legal for all of the common
"Unix" filesystems (EXT3, XFS, Reiser, etc.).

However, the OP hasn't offered any details about what it is
he's actually wanting to do, so this is all just idle
speculation...

--
Grant Edwards grante Yow! I know how to do
at SPECIAL EFFECTS!!
visi.com
May 8 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.