pathlib PurePosixPath

Chris Angelico rosuav at gmail.com
Tue Oct 10 05:58:43 EDT 2017


On Tue, Oct 10, 2017 at 8:56 PM, Tim Golden <mail at timgolden.me.uk> wrote:
>> My understanding of the document you linked to
>> is that the colon still has special meaning, and thus you can't use it
>> in arbitrary file names.
>
>
> In fact its presence in that filename creates a (usually hidden) data stream
> piggybacked onto that file which has the name "abc" into which the data is
> written.
>
> So, following on, the follow works:
>
> assert open("temp.txt:abc").read() == "abc"

Cool. Does it require that temp.txt exist first? And if you have
multiple colons (as in the OP's), does the part after the second colon
have to be a type indicator?

ChrisA



More information about the Python-list mailing list