gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: path handling


From: Richard Frith-Macdonald
Subject: Re: path handling
Date: Thu, 11 Aug 2016 08:29:06 +0100

> On 11 Aug 2016, at 06:43, Giah de Barag <address@hidden> wrote:
> 
> Path handling is a behavior from cygwin that is in msys and in GNUstep 
> (GSPathHandling in NSBundle and NSString) that interprets unix paths and maps 
> them to the actual windows path.
> 
> I was under the impression it could be disabled.

In an earlier post you mentioned disabling tpath handling in gnustep-make.

So I think we should draw a clear distinction between built-time (how 
gnustep-make builds libraries, tools and apps) and runtime (how those 
librariews, tools and apps behave when they are running).

At build-time, gnustep-make operates in an msys environment ... so gnustep-make 
uses msys paths.

At runtime, GNUstep doesn't support cygwin, and doesn't depend on or change 
anything in cygwin, nor does it depend oon or change anything in msys ... it 
uses native windows calls to do everything.  The APIs that tools and 
applications use (Cocoa/OpenStep) provide for portable handling of paths, so 
that the same code can work on any operating system.

In neither case does it make sense to talk about path handling being 'disabled' 
(obviously a program without path handling can't interasct with the filesystem).

I guess the closest concept would be the GSPathHandling() function; which lets 
you tweak the way the path manipulation methods in the NSString class operate 
at runtime. It allows for three modes of operation;
The standard mode ('gnustep') is for when you are writing portable code (which 
is what we encourage), and are properly using the API to work entirely with 
relative paths appended to known locations provided by standard functions in 
the API.
The 'unix' mode is for non-portable code on unix, where you are assuming a unix 
filesystem with '/' at its root, so any path beginning with '/' is assumed to 
be absolute
The 'windows' mode is for non-portable code where you are assuming a windows 
filesystem and a path starting with '/' is assumed to be relative unless it's a 
windows UNC path.

This is covered at the start of the NSString class documentation.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]