Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #7754

Re: os.path and Path

Date 2011-06-16 10:18 -0700
From Ethan Furman <ethan@stoneleaf.us>
Subject Re: os.path and Path
References <mailman.8.1308188800.1164.python-list@python.org> <4DF9AADE.6090609@gmail.com> <4df9b7be$0$29973$c3e8da3$5496439d@news.astraweb.com> <mailman.20.1308240105.1164.python-list@python.org> <4dfa324e$0$30002$c3e8da3$5496439d@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.24.1308243852.1164.python-list@python.org> (permalink)

Show all headers | View raw


Steven D'Aprano wrote:
> On Thu, 16 Jun 2011 09:16:22 -0700, Ethan Furman wrote:
> 
>> Steven D'Aprano wrote:
>>> If Path is intended to be platform independent, then these two paths
>>> could represent the same location:
>>>
>>> 'a/b/c:d/e'  # on Linux or OS X
>>> 'a:b:c/d:e'  # on classic Mac pre OS X
>>>
>>> and be impossible on Windows. So what's the canonical path it should be
>>> converted to?
>> Are these actual valid paths?  I thought Linux used '/' and Mac used
>> ':'.
> 
> Er, perhaps I wasn't as clear as I intended... sorry about that.
> 
> On a Linux or OS X box, you could have a file e inside a directory c:d 
> inside b inside a. It can't be treated as platform independent, because 
> c:d is not a legal path component under classic Mac or Windows.
> 
> On a classic Mac (does anyone still use them?), you could have a file e 
> inside a directory c/d inside b inside a. Likewise c/d isn't legal under 
> POSIX or Windows.
> 
> So there are paths that are legal under one file system, but not others, 
> and hence there is no single normalization that can represent all legal 
> paths under arbitrary file systems.

Yeah, I was just realizing that about two minutes before I read this 
reply.  Drat.  This also makes your comment about sensible path objects 
more sensible.  ;)

~Ethan~

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

os.path and Path Ethan Furman <ethan@stoneleaf.us> - 2011-06-15 19:00 -0700
  Re: os.path and Path Laurent Claessens <moky.math@gmail.com> - 2011-06-16 09:03 +0200
    Re: os.path and Path Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-16 07:58 +0000
      Re: os.path and Path Ethan Furman <ethan@stoneleaf.us> - 2011-06-16 09:16 -0700
        Re: os.path and Path Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-16 16:41 +0000
          Re: os.path and Path Ethan Furman <ethan@stoneleaf.us> - 2011-06-16 10:18 -0700
          Re: os.path and Path Eric Snow <ericsnowcurrently@gmail.com> - 2011-06-16 11:21 -0600
      Re: os.path and Path Christian Heimes <lists@cheimes.de> - 2011-06-16 18:32 +0200
      Re: os.path and Path Ethan Furman <ethan@stoneleaf.us> - 2011-06-16 10:07 -0700
      Re: os.path and Path Chris Angelico <rosuav@gmail.com> - 2011-06-17 11:00 +1000
  Re: os.path and Path Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-06-16 07:14 +0000
    Re: os.path and Path Ethan Furman <ethan@stoneleaf.us> - 2011-06-16 09:05 -0700
      Re: os.path and Path Chris Torek <nospam@torek.net> - 2011-06-17 00:48 +0000
        Re: os.path and Path Ethan Furman <ethan@stoneleaf.us> - 2011-06-16 18:19 -0700
        Re: os.path and Path Ned Deily <nad@acm.org> - 2011-06-16 19:55 -0700
          Re: os.path and Path rusi <rustompmody@gmail.com> - 2011-06-16 21:24 -0700

csiph-web