os.path.join() necessary?

David LeBlanc whisper at oz.net
Thu May 23 12:54:53 EDT 2002


Actually, Windows accepts "/" virtually everywhere except on the command
line. Even in Visual C++, it's easier to use "/" then "\" since you have to
escape all the backslashes since C/C++ is sensitive to them.

David LeBlanc
Seattle, WA USA

> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Thomas Guettler
> Sent: Thursday, May 23, 2002 7:30
> To: python-list at python.org
> Subject: Re: os.path.join() necessary?
>
>
> Michael Chermside wrote:
>
> > I think it would be a nice feature of a programming language that all
> > file-and-path names are expressed using '/' within the language and
> > automatically converted to the platform-appropriate format by the
> > language itself (and paths obtained from the OS are converted to '/'
> > format also). Unfortunately, as far as I know, Python is not that
> > language. I *think* (someone more knowledgable please correct me if I'm
> > wrong) that "wierd" OSes like VMS (and there's MUCH wierder stuff out
> > there) don't do this conversion. Unix & friends don't need it, Windows
> > DOES do the conversion, and I don't know about Macs. But for TRUE
> > portability, I believe you still have to deal with os.path.join().
>
>
> I was suprised that I can use (dir + '/' + file) on windows.
> Since my application will only run on windows and unix I won't
> use os.path.join()
>
>
> If you just want to join a directory and a file it is no problem,
> but I store paths in a database. This would mean I would have to
> transform the path to the current operating system each time I get
> it from the database.
>
>   thomas
>
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list






More information about the Python-list mailing list