phobo's std.file is completely broke!

Nick Sabalausky (Abscissa) SeeWebsiteToContactMe at semitwist.com
Wed Sep 19 01:50:54 UTC 2018


On 09/15/2018 06:40 AM, Vladimir Panteleev wrote:
> On Saturday, 15 September 2018 at 10:05:26 UTC, Josphe Brigmo wrote:
> 
>> Also, windows 10 does not have this problem
> 
> What do you mean by "windows 10"? Do you mean Explorer, the default file 
> manager?
> 

According to MS docs:

"Starting in Windows 10, version 1607, MAX_PATH limitations have been 
removed from common Win32 file and directory functions. However, you 
must opt-in to the new behavior."

-- From: 
https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation

It goes on to explain the registry setting for that.


>> If it did I wouldn't have had this problem and wasted a day of my life 
>> trying to figure out what is going on(I didn't design my program 
>> around having to hack such things, I just assumed they would work, 
>> because, after all, they should, right?).
> 
> I, too, spent a LOT of time fighting the Windows filesystem APIs. See 
> e.g. * 
> https://dump.thecybershadow.net/d78d9911adc16ec749914b6923759454/longpathdelete.d 
> (that also sets ownership/ACLs via external processes, as the C API is 
> unreasonably complicated).
> 
> The problem is 100% due to Windows.
> 
> It was one of the big reasons why I moved to Linux for software 
> development. Such problems do not exist there.
> 

Agreed, but this sounds to me like a perfect reason to abstract away as 
much as that garbage as we reasonably can. D's in the business of 
improving the user-experience of programming, not the promotion of one 
OS over another.

Bear in mind, the very point of plenty of things in Phobos, or any std 
lib for that matter, is to abstract away the need to waste everyone's 
time making them fiddle about with pointless little OS differences. 
Sure, there are going to be things that can't be reasonably abstracted 
away, but that's FAR from justifying not doing what we can. Again: 
normal expectations should be the default and just work, exceptional 
needs should still be possible.

And at least for me, moving from Windows to Linux would have been a LOT 
harder if it weren't for the OS abstractions that are already in Phobos.


More information about the Digitalmars-d mailing list