Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #93203
| From | Albert-Jan Roskam <sjeik_appie@hotmail.com> |
|---|---|
| Subject | Re: windows and file names > 256 bytes |
| Date | 2015-06-26 17:58 +0000 |
| References | (2 earlier) <CAB1GNpS=7F3ebrHenUu7+MvyWuk5v60G6N6L81c0W3C-mQPi2w@mail.gmail.com> <558BF55C.2010701@timgolden.me.uk> <558C038A.5010103@gmail.com> <558C0433.2050601@timgolden.me.uk> <mmk3a6$hrb$1@ger.gmane.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.110.1435341547.3674.python-list@python.org> (permalink) |
<snip>
> import os import shutil import sys
>
> # create an insanely long directory tree p = os.getenv("TEMP")
> #p = ur"\\server\share\blah\temp"
> tmpdir = p os.chdir(tmpdir)
> for i in xrange(1000):
> tmpdir = os.path.join(tmpdir, "sub") os.mkdir("\\\\?\\" + tmpdir)
> #os.mkdir(u"\\\\?\\UNC" + tmpdir[1:])
>
> # write a file to it deep = "\\\\?\\" + os.path.join(tmpdir, "deep.txt")
> assert os.path.exists(deep)
sorry, this "assert" should of course follow 'with open(..'
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: windows and file names > 256 bytes Albert-Jan Roskam <sjeik_appie@hotmail.com> - 2015-06-26 17:58 +0000
csiph-web