Feedback wanted on programming introduction (Python in Windows)

Rhodri James rhodri at wildebst.demon.co.uk
Sun Nov 1 19:08:37 EST 2009


On Sun, 01 Nov 2009 21:20:20 -0000, Alf P. Steinbach <alfps at start.no>  
wrote:

> * Rhodri James:

This is a weird attribution style, by the way.  I don't think it helps.

>> On Fri, 30 Oct 2009 03:26:45 -0000, Alf P. Steinbach <alfps at start.no>  
>> wrote:
>>
>>> * Rhodri James:
>>>> On Thu, 29 Oct 2009 16:53:05 -0000, Alf P. Steinbach <alfps at start.no>  
>>>> wrote:
>>>>> with the best knowledge of the program's environment, is unable to  
>>>>> handle (such as delete) files or folders with paths greater than  
>>>>> some 260 characters, is unable to handle filenames that differ only  
>>>>> in case and are in the same directory, and is unable to e.g. delete  
>>>>> a folder called "con"  --  although such files & folders can very  
>>>>> easily be created.
>>>>  You may or may not be aware that some of these things are  
>>>> limitations of
>>>> the underlying disc format,
>>>
>>> Sorry no, it isn't.
>>>
>>> Even assuming you meant the more reasonable "file system", no, it  
>>> isn't.
>>  Actually I should have mentioned the filing system as well as the disc
>> format (which does matter).  I may not be using correct Windows  
>> terminology,
>> since I'm referring to both the bytes on hardware and the software stack
>> that terminates in the OS API.
>>  Still, colour me surprised.  I had assumed that NTFS had some (large)
>> limit on filenames, and 256 sounded plausible.
>
> For NTFS it's 32K or 64K wide characters, I don't recall which. But  
> what's important is that that's also the API level limit. You can find  
> most of the details in Microsoft's documentation of CreateFile (but it's  
> off-topic here).

Actually it's not, since it's a perfect example of the "not reading quite
carefully enough" others have pointed out before.  You make this statement
as an absolute, iron-clad assertion.  Checking the MS website, we find it
actually says:

"Maximum Path Length Limitation

In the Windows API (with some exceptions discussed in the following  
paragraphs), the maximum length for a path is MAX_PATH, which is defined  
as 260 characters."

The exceptions are unicode versions of some of the functions, which do
give you ~32K characters.  However, the docs are pretty specific about
what is and isn't the API limit.  Since this applies to the command
line just as much as to GUIs, I'll repeat my claim that blaming Explorer
for something that causes just as much grief on a command line is a
tad unfair.

More importantly, I accuse you of making very definitive statments
that turn out to be insufficiently researched.  That's not an
encouraging state of affairs in someone planning to write a beginners'
textbook.  Having originally learned C from one of Herbert Schildt's
books, I reckon I've earned the right to be highly allergic to this!

-- 
Rhodri James *-* Wildebeest Herder to the Masses



More information about the Python-list mailing list