std.path review: update

2011-07-17 Thread Lars T. Kyllingstad
Based on your comments, I have made some changes to my std.path proposal. A list of the changes I have made can be found at the following address (look at the commits dated 2011-07-17): https://github.com/kyllingstad/phobos/commits/std-path I believe I have covered most of your requests, wit

Re: std.path review: update

2011-07-17 Thread bearophile
Lars T. Kyllingstad: > I believe I have covered most of your requests, with a few exceptions: compatibleStrings is a template still. Bye, bearophile

Re: std.path review: update

2011-07-17 Thread Andrej Mitrovic
On 7/17/11, Lars T. Kyllingstad wrote: > - Should I add toNativePath(), which replaces '/' with '\' on Windows and > vice versa on POSIX? Actually I withdraw that feature request. Some tools will work with only forward slashes, others only backward slashes, but this is regardless of what platform

Re: std.path review: update

2011-07-17 Thread Jesse Phillips
On Sun, 17 Jul 2011 21:27:41 +, Lars T. Kyllingstad wrote: > - Should I add toNativePath(), which replaces '/' with '\' on Windows > and vice versa on POSIX? I'm not sure my opinion on this. It seems like a useful idea, but as Andrej points out it make just cause other issues. > - Should i

Re: std.path review: update

2011-07-17 Thread Brian Schott
The documentation comments for driveName say that the return value will be an empty string in some circumstances, but the code and unit tests both say that the behavior is to return null.

Re: std.path review: update

2011-07-17 Thread Jonathan M Davis
On Sunday 17 July 2011 22:08:27 Brian Schott wrote: > The documentation comments for driveName say that the return value will > be an empty string in some circumstances, but the code and unit tests > both say that the behavior is to return null. The fun part with that is that "" == null and a null

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Sun, 17 Jul 2011 17:43:42 -0400, bearophile wrote: > Lars T. Kyllingstad: > >> I believe I have covered most of your requests, with a few exceptions: > > compatibleStrings is a template still. I know. Sorry, forgot to mention that. For now, I'd like to keep it the way it is. I can't find

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 00:24:30 +0200, Andrej Mitrovic wrote: > On 7/17/11, Lars T. Kyllingstad wrote: >> - Should I add toNativePath(), which replaces '/' with '\' on Windows >> and vice versa on POSIX? > > Actually I withdraw that feature request. Some tools will work with only > forward slashes,

Re: std.path review: update

2011-07-18 Thread Jonathan M Davis
On Monday 18 July 2011 09:35:17 Lars T. Kyllingstad wrote: > On Sun, 17 Jul 2011 17:43:42 -0400, bearophile wrote: > > Lars T. Kyllingstad: > >> I believe I have covered most of your requests, with a few exceptions: > > compatibleStrings is a template still. > > I know. Sorry, forgot to mention t

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Sun, 17 Jul 2011 22:38:43 -0700, Jonathan M Davis wrote: > On Sunday 17 July 2011 22:08:27 Brian Schott wrote: >> The documentation comments for driveName say that the return value will >> be an empty string in some circumstances, but the code and unit tests >> both say that the behavior is to

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Sun, 17 Jul 2011 21:27:41 +, Lars T. Kyllingstad wrote: > Based on your comments, I have made some changes to my std.path > proposal. A list of the changes I have made can be found at the > following address (look at the commits dated 2011-07-17): > > https://github.com/kyllingstad/phob

Re: std.path review: update

2011-07-18 Thread bearophile
Jonathan M Davis: > And it _should_ be a template. All of the stuff like that are templates. And > I'm not even sure that it _can_ be a function. And even if it can, what would > we gain by making it a function anyway? It's operating on types. It's of no > use at runtime. It's a perfect candida

Re: std.path review: update

2011-07-18 Thread torhu
On 18.07.2011 11:42, Lars T. Kyllingstad wrote: On Sun, 17 Jul 2011 22:38:43 -0700, Jonathan M Davis wrote: On Sunday 17 July 2011 22:08:27 Brian Schott wrote: The documentation comments for driveName say that the return value will be an empty string in some circumstances, but the code and

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 14:23:18 +0200, torhu wrote: > On 18.07.2011 11:42, Lars T. Kyllingstad wrote: >> On Sun, 17 Jul 2011 22:38:43 -0700, Jonathan M Davis wrote: >> >>> On Sunday 17 July 2011 22:08:27 Brian Schott wrote: The documentation comments for driveName say that the return value >>>

Re: std.path review: update

2011-07-18 Thread Andrei Alexandrescu
On 7/18/11 7:23 AM, torhu wrote: On 18.07.2011 11:42, Lars T. Kyllingstad wrote: On Sun, 17 Jul 2011 22:38:43 -0700, Jonathan M Davis wrote: On Sunday 17 July 2011 22:08:27 Brian Schott wrote: The documentation comments for driveName say that the return value will be an empty string in some c

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 09:38:08 -0500, Andrei Alexandrescu wrote: > On 7/18/11 7:23 AM, torhu wrote: >> On 18.07.2011 11:42, Lars T. Kyllingstad wrote: >>> On Sun, 17 Jul 2011 22:38:43 -0700, Jonathan M Davis wrote: >>> On Sunday 17 July 2011 22:08:27 Brian Schott wrote: > The documentation

Re: std.path review: update

2011-07-18 Thread Vladimir Panteleev
Sorry, I thought you meant the old getExt().

Re: std.path review: update

2011-07-18 Thread Vladimir Panteleev
On Mon, 18 Jul 2011 18:07:12 +0300, Lars T. Kyllingstad wrote: The fact that extension() currently *does* behave as Vladimir wants is, in my opinion, an implementation detail. Is it still an implementation detail if it's documented behavior? -- Best regards, Vladimir

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 10:05:07 +, Lars T. Kyllingstad wrote: > On Sun, 17 Jul 2011 21:27:41 +, Lars T. Kyllingstad wrote: > >> Based on your comments, I have made some changes to my std.path >> proposal. A list of the changes I have made can be found at the >> following address (look at th

Re: std.path review: update

2011-07-18 Thread Jonathan M Davis
On Monday 18 July 2011 06:28:50 bearophile wrote: > Jonathan M Davis: > > And it _should_ be a template. All of the stuff like that are templates. > > And I'm not even sure that it _can_ be a function. And even if it can, > > what would we gain by making it a function anyway? It's operating on > >

Re: std.path review: update

2011-07-18 Thread Steven Schveighoffer
On Sun, 17 Jul 2011 17:27:41 -0400, Lars T. Kyllingstad wrote: Based on your comments, I have made some changes to my std.path proposal. A list of the changes I have made can be found at the following address (look at the commits dated 2011-07-17): https://github.com/kyllingstad/phobos/co

Re: std.path review: update

2011-07-18 Thread Steven Schveighoffer
On Sun, 17 Jul 2011 18:24:30 -0400, Andrej Mitrovic wrote: On 7/17/11, Lars T. Kyllingstad wrote: - Should I add toNativePath(), which replaces '/' with '\' on Windows and vice versa on POSIX? Actually I withdraw that feature request. Some tools will work with only forward slashes, othe

Re: std.path review: update

2011-07-18 Thread bearophile
Jonathan M Davis: > But what you're doing is basically the same as > the eponymous template except that it's saving the value to in a function so > that it can be called at runtime. The gain is 0 and potentially confusing. > It's no better than > > bool compatibleStringsFunc(Strings...)() > { >

Re: std.path review: update

2011-07-18 Thread Steven Schveighoffer
On Mon, 18 Jul 2011 08:23:18 -0400, torhu wrote: On 18.07.2011 11:42, Lars T. Kyllingstad wrote: On Sun, 17 Jul 2011 22:38:43 -0700, Jonathan M Davis wrote: On Sunday 17 July 2011 22:08:27 Brian Schott wrote: The documentation comments for driveName say that the return value will be an

Re: std.path review: update

2011-07-18 Thread torhu
On 18.07.2011 16:18, Lars T. Kyllingstad wrote: On Mon, 18 Jul 2011 14:23:18 +0200, torhu wrote: I'd like to make a case for null as the 'nothing here' value. The advantage of using null is that all possible ways of testing for 'nothingness' (is, ==, as a boolean condition, empty range) wil

Re: std.path review: update

2011-07-18 Thread Jonathan M Davis
On 2011-07-18 10:51, torhu wrote: > On 18.07.2011 16:18, Lars T. Kyllingstad wrote: > > On Mon, 18 Jul 2011 14:23:18 +0200, torhu wrote: > >> I'd like to make a case for null as the 'nothing here' value. > >> > >> The advantage of using null is that all possible ways of testing for > >> 'nothingne

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: > On Sun, 17 Jul 2011 17:27:41 -0400, Lars T. Kyllingstad > wrote: > >> Based on your comments, I have made some changes to my std.path >> proposal. A list of the changes I have made can be found at the >> following address (look a

Re: std.path review: update

2011-07-18 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 13:26:08 -0400, Steven Schveighoffer wrote: > On Sun, 17 Jul 2011 18:24:30 -0400, Andrej Mitrovic > wrote: > >> On 7/17/11, Lars T. Kyllingstad wrote: >>> - Should I add toNativePath(), which replaces '/' with '\' on Windows >>> and >>> vice versa on POSIX? >> >> Actually I

Re: std.path review: update

2011-07-18 Thread Jonathan M Davis
On 2011-07-18 11:25, Lars T. Kyllingstad wrote: > On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: > > On Sun, 17 Jul 2011 17:27:41 -0400, Lars T. Kyllingstad > > > > wrote: > >> Based on your comments, I have made some changes to my std.path > >> proposal. A list of the changes I

Re: std.path review: update

2011-07-18 Thread Steven Schveighoffer
On Mon, 18 Jul 2011 14:30:51 -0400, Lars T. Kyllingstad wrote: On Mon, 18 Jul 2011 13:26:08 -0400, Steven Schveighoffer wrote: On Sun, 17 Jul 2011 18:24:30 -0400, Andrej Mitrovic wrote: On 7/17/11, Lars T. Kyllingstad wrote: - Should I add toNativePath(), which replaces '/' with '\' on

Re: std.path review: update

2011-07-18 Thread Steven Schveighoffer
On Mon, 18 Jul 2011 14:25:57 -0400, Lars T. Kyllingstad wrote: On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: In driveName: Should std.path handle uunc paths? i.e. \\servername\share\path (I think if it does, it should specify \\servername\share as the drive) Yes, std

Re: std.path review: update

2011-07-19 Thread Nick Sabalausky
"Lars T. Kyllingstad" wrote in message news:j01trl$2ia$6...@digitalmars.com... > On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: >> In driveName: >> >> Should std.path handle uunc paths? i.e. \\servername\share\path (I >> think if it does, it should specify \\servername\share as

Re: std.path review: update

2011-07-19 Thread Andrej Mitrovic
Here's some relevant info: http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx

Re: std.path review: update

2011-07-20 Thread Steven Schveighoffer
On Tue, 19 Jul 2011 15:55:29 -0400, Nick Sabalausky wrote: If such mountings are possible, it would seem that there must be some way to check the sensitivity (otherwise the OS itself would probably crap out on it). I've done it before, mounted a windows share on a linux box via cifs. What

Re: std.path review: update

2011-07-20 Thread Lars T. Kyllingstad
On Mon, 18 Jul 2011 14:51:06 -0400, Steven Schveighoffer wrote: > On Mon, 18 Jul 2011 14:25:57 -0400, Lars T. Kyllingstad > wrote: > >> On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: > >>> In driveName: >>> >>> Should std.path handle uunc paths? i.e. \\servername\share\path (

Re: std.path review: update

2011-07-20 Thread Steven Schveighoffer
On Wed, 20 Jul 2011 13:36:51 -0400, Lars T. Kyllingstad wrote: On Mon, 18 Jul 2011 14:51:06 -0400, Steven Schveighoffer wrote: On Mon, 18 Jul 2011 14:25:57 -0400, Lars T. Kyllingstad wrote: On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: In driveName: Should std.path

Re: std.path review: update

2011-07-20 Thread Lars T. Kyllingstad
On Wed, 20 Jul 2011 14:16:04 -0400, Steven Schveighoffer wrote: > I'm not sure how \\server interacts with the low level functions of > Windows (such as CreateFile). Some research/experimentation is probably > warranted. Any .NET programmers out there? Can you please tell me what the following

Re: std.path review: update

2011-07-20 Thread Lars T. Kyllingstad
On Wed, 20 Jul 2011 17:36:51 +, Lars T. Kyllingstad wrote: > On Mon, 18 Jul 2011 14:51:06 -0400, Steven Schveighoffer wrote: > >> On Mon, 18 Jul 2011 14:25:57 -0400, Lars T. Kyllingstad >> wrote: >> >>> On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: >> In driveName: >

Re: std.path review: update

2011-07-20 Thread Lars T. Kyllingstad
On Tue, 19 Jul 2011 15:55:29 -0400, Nick Sabalausky wrote: > "Lars T. Kyllingstad" wrote in message > news:j01trl$2ia$6...@digitalmars.com... >> On Mon, 18 Jul 2011 13:16:29 -0400, Steven Schveighoffer wrote: >>> In driveName: >>> >>> Should std.path handle uunc paths? i.e. \\servername\share\pa

Re: std.path review: update

2011-07-20 Thread Alix Pexton
On 20/07/2011 20:57, Lars T. Kyllingstad wrote: Does anyone know whether Windows' case insensitivity is limited to ASCII? If not, is the filesystem Unicode-aware, or does it uses some locale specific codepage to compare file names? -Lars Wikipedia says Windows long file names are up to 255 UT

Re: std.path review: update

2011-07-21 Thread Rainer Schuetze
Does anyone know whether Windows' case insensitivity is limited to ASCII? If not, is the filesystem Unicode-aware, or does it uses some locale specific codepage to compare file names? I just tried a few examples: Using umlauts works as expected, i.e. upper or lower case characters are treated

Re: std.path review: update

2011-07-21 Thread Rainer Schuetze
On 20.07.2011 20:16, Steven Schveighoffer wrote: ls //root lists the contents of /root. I'd guess that opening //root with open() would simply open /root. Given that context, they should not be considered to be a server path IMO. If that's true for the bare open() without going through possi

Re: std.path review: update

2011-07-21 Thread Rainer Schuetze
On 20.07.2011 19:36, Lars T. Kyllingstad wrote: On Mon, 18 Jul 2011 14:51:06 -0400, Steven Schveighoffer wrote: It's definitely something to think about. At the very least, I think the default file system case sensitivity should be mapped to a certain function. It doesn't hurt to expose the

Re: std.path review: update

2011-07-21 Thread Jussi Jumppanen
Lars T. Kyllingstad Wrote: > On Wed, 20 Jul 2011 14:16:04 -0400, Steven Schveighoffer wrote: > > Any .NET programmers out there? Can you please tell me what the > following functions return? > > System.IO.Path.GetDirectoryName("\\foo\bar") > System.IO.Path.GetPathRoot("\\foo\bar\baz") This

Re: std.path review: update

2011-07-21 Thread Lars T. Kyllingstad
On Wed, 20 Jul 2011 22:20:16 +0100, Alix Pexton wrote: > On 20/07/2011 20:57, Lars T. Kyllingstad wrote: >> >> Does anyone know whether Windows' case insensitivity is limited to >> ASCII? If not, is the filesystem Unicode-aware, or does it uses some >> locale specific codepage to compare file name

Re: std.path review: update

2011-07-21 Thread Lars T. Kyllingstad
On Thu, 21 Jul 2011 09:09:52 +0200, Rainer Schuetze wrote: > On 20.07.2011 20:16, Steven Schveighoffer wrote: >> >> ls //root lists the contents of /root. I'd guess that opening //root >> with open() would simply open /root. Given that context, they should >> not be considered to be a server path

Re: std.path review: update

2011-07-21 Thread Lars T. Kyllingstad
On Thu, 21 Jul 2011 03:36:37 -0400, Jussi Jumppanen wrote: > Lars T. Kyllingstad Wrote: > >> On Wed, 20 Jul 2011 14:16:04 -0400, Steven Schveighoffer wrote: >> >> Any .NET programmers out there? Can you please tell me what the >> following functions return? >> >> System.IO.Path.GetDirectoryNa

Re: std.path review: update

2011-07-21 Thread torhu
On 17.07.2011 23:27, Lars T. Kyllingstad wrote: - Should it be specified/documented whether a function returns "" or null? Specifically, is it important that extension("foo") is null extension("foo.") !is null&& extension("foo.") == "" I guess you've already thought about this, but