os.path.join() necessary?

Thomas Guettler zopestoller at thomas-guettler.de
Thu May 23 10:30:11 EDT 2002


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






More information about the Python-list mailing list