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


Groups > comp.lang.python > #93091

windows and file names > 256 bytes

Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!us.feeder.erje.net!news2.arglkargh.de!diablo1.news.osn.de!news.osn.de!diablo2.news.osn.de!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'paths': 0.05; 'skip:\\ 20': 0.05; 'skip:\\ 10': 0.07; 'subject:file': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'truncate': 0.09; 'bug': 0.10; 'python': 0.11; '2.7': 0.13; 'notations': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'silly': 0.16; 'subject:windows': 0.16; 'win7': 0.16; 'xp?': 0.16; 'python?': 0.18; '(not': 0.20; 'windows': 0.20; 'software.': 0.22; 'questions:': 0.22; 'header:User-Agent:1': 0.26; 'header:X -Complaints-To:1': 0.26; '[2]': 0.27; '---': 0.30; 'e.g.': 0.31; 'checked': 0.31; '[1]': 0.32; 'file': 0.34; 'to:addr:python-list': 0.35; 'fail': 0.35; 'skip:o 20': 0.35; 'hi,': 0.37; 'received:org': 0.38; 'to:addr:python.org': 0.39; 'sure': 0.40; 'where': 0.40; 'even': 0.61; 'more': 0.62; 'details': 0.63; 'antivirus': 0.66; 'received:nl': 0.72; 'avast': 0.84; 'calls,': 0.84; 'prefix)': 0.84; 'dealt': 0.91
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Albert-Jan Roskam <fomcl@yahoo.com>
Subject windows and file names > 256 bytes
Date Wed, 24 Jun 2015 17:45:31 +0000 (UTC)
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host 82-170-182-209.ip.telfort.nl
User-Agent Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)
X-Antivirus avast! (VPS 150622-3, 06/22/2015), Outbound message
X-Antivirus-Status Clean
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.23.1435168510.3674.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1435168510 news.xs4all.nl 2925 [2001:888:2000:d::a6]:48429
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:93091

Show key headers only | View raw


Hi,

Consider the following calls, where very_long_path is more than 256 bytes:
[1] os.mkdir(very_long_path)
[2] os.getsize(very_long_path)
[3] shutil.rmtree(very_long_path)

I am using Python 2.7 and [1] and [2] fail under Windows XP [3] fails 
under Win7 (not sure about XP). This is even when I use the "special" 
notations \\?\c:\dir\file or \\?\UNC\server\share\file, e.g.
os.path.getsize("\\\\?\\" + "c:\\dir\\file")
(Oddly, os.path.getsize(os.path.join("\\\\?", "c:\\dir\\file")) will 
truncate the prefix)

My questions:
1. How can I get the file size of very long paths under XP?
2. Is this a bug in Python? I would prefer if Python dealt with the gory 
details of Windows' silly behavior.

Regards,
Albert-Jan

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

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


Thread

windows and file names > 256 bytes Albert-Jan Roskam <fomcl@yahoo.com> - 2015-06-24 17:45 +0000
  Re: windows and file names > 256 bytes Tobiah <toby@tobiah.org> - 2015-07-07 08:56 -0700

csiph-web