On Tue, 12 Apr 2022 at 03:49, Steven D'Aprano <[email protected]> wrote:
> > Windows has up to 27 working directories per process. There's the
> > overall working directory directory, plus one for each drive.
>
> Today I learned something new, thank you.
>
> How does that work in practice? In Windows, if you just say the
> equivalent to `open('spam')`, how does the OS know which drive
> and WD to use?
It uses the "default drive" + "current directory on that drive".
If you say `open("c:spam")`, Windows uses "drive C" + "current
directory on drive C".
If you say `open("/spam")`, Windows uses "default drive" + "explicit directory".
Hence there are 26 current directories (one per drive), plus the
selection of current drive, which effectively chooses your current
directory.
ChrisA
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/KTQZRVCDC47HEFP26LP3WH6IS3Z2X5TK/
Code of Conduct: http://python.org/psf/codeofconduct/