[M3devel] Change Pathname abstraction for Windows? was: RE: RC3 build problems, was: RE: caltech-parser NT386 Hudson problems

jay.krell at cornell.edu jay.krell at cornell.edu
Fri Aug 28 13:33:45 CEST 2009


I believe this goes back to CP/M compatibility.

I wish the file open dialogs accepted forward slashes. :(

I will change cm3 to write back into quake state the canonicalized  
forms.

I believe I already changed Pathname on Windows to accept either slash.

I need to check if equality uses decomposed elements.

Lots of folks just use strings and skip the abstraction, such as cm3.  
My personal programming often uses a small library over strings --  
GetLastPathElement, RemoveLastElement, JoinPath,  
EnsureTrailingPathSeparator, ...

IMHO you might as well also have posix allow backward slashes as  
separators, but that was rejected here.

To wit I believe cygwin now accepts colons and backward slashes in  
paths, as non-separators. Interix also one or the other or both.  
Interix encodes them by oring in 0xFF00 (what happens with Samba to  
ext3??)

There are other issues such as case sensivity not being an OS-wide  
thing but per volume or directory (NTFS has mount points, directories  
can lead to volumes, with different filesystems) as well as just what  
the case mapping tables are (written to NTFS volume at time of format,  
presumably can vary).

The Mac historically used colon as separator and allowed forward slash  
as non separator. Presumably hidden through some encoding/decoding at  
the posix layer?

  - Jay (phone)

On Aug 28, 2009, at 4:26 AM, Olaf Wagner <wagner at elegosoft.com> wrote:

> Quoting Jay K <jay.krell at cornell.edu>:
>
>> It was backslashes vs. forward slashes as I had originally suspected.
>> My debugprinting never hit because I was guessing the elego paths  
>> wrong.
>> I finally made it always print and tested it in-situ in the VM.
>
> It is amazing how much (pointless) work the difference in pathname
> denotations on Windows and POSIX systems has caused and still causes.
> While there are some conceptual differences that cannot easily be
> generalized (one root <-> many roots, logical <-> physical view of
> disks etc.), the simple fact that Windows uses \ instead of /
> makes life needlessly difficult for many programmers.
>
> In Modula-3, the Pathname interface is intended to abstract from
> this, but this works only to a certain degree. It uses \ as the
> arc separator on Windows, while in fact all modern Windows systems
> accept both \ and /. I think this should be corrected.
>
> Pathnames should be split into elements at both \ and / on Windows,
> and checks for equality should ignore any differences in separator
> characters only. Does this sound reasonable?
>
> Is there any (non)obvious problem I'm overseeing right now which
> will make this strategy fail?
>
> Olaf
>
> PS: I'm not suggesting we do that in this release of course...
> -- 
> Olaf Wagner -- elego Software Solutions GmbH
>               Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germ 
> any
> phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
>   http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Be 
> rlin
> Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr:  
> DE163214194
>
>



More information about the M3devel mailing list