digitalmars.D - Email for std.path submissions
- Kramer (5/5) Feb 17 2006 Walter,
- bobef (3/12) Feb 17 2006 Just from curiosity, because I did the same thing today, what functions
- Kramer (24/36) Feb 17 2006 Nice. Looks like there's at least 2 people who want some more path
- bobef (9/53) Feb 17 2006 I was thinking to make variadic join. It is nice not make double efforts...
- Derek Parnell (15/34) Feb 17 2006 Add another person. My Build utility has a number of extentions to
- Walter Bright (6/8) Feb 17 2006 I received both of your emails about it. I guess we'll have to do a merg...
- bobef (2/4) Feb 17 2006 What is an "explicit release"?
- Walter Bright (4/8) Feb 17 2006 Explicitly saying you are placing it into the public domain. Imagine you...
- bobef (6/18) Feb 17 2006 I hate this shit. Here I place this source and allow everyone to do
- Walter Bright (4/8) Feb 18 2006 I understand completely and hate to be pedantic, but please add "I wrote...
- bobef (1/12) Feb 18 2006
- bobef (1/1) Feb 18 2006 Hope this do the trick...
- Miles (7/18) Feb 24 2006 It is not correct to remove '..' on Linux. '/a/../b' is not garanteed to
- bobef (4/21) Feb 24 2006 Never thought of that.
- Miles (9/12) Feb 24 2006 Yes, it is not correct.
- Todor Totev (44/56) Feb 24 2006 About Windows NT based systems:
- Kramer (9/27) Feb 24 2006 Python does the same thing with it's normpath function.
- bobef (1/1) Feb 19 2006 Written and placed into the public domain by Borislav Peev (bobef).
- Kramer (2/10) Feb 17 2006 Great! I'll be sending my source tonight (no access to it at work).
- BCS (6/20) Feb 17 2006 In that line: 3D math libs anyone??
Walter, Is there an email address I can use to submit some functions for your review into std.path? I used the email that is on your N.G. postings, but I don't know if my work email stomped on my outgoing or any potential incoming. -Kramer
Feb 17 2006
Kramer wrote:Walter, Is there an email address I can use to submit some functions for your review into std.path? I used the email that is on your N.G. postings, but I don't know if my work email stomped on my outgoing or any potential incoming. -KramerJust from curiosity, because I did the same thing today, what functions are you submitting to std.path?
Feb 17 2006
In article <dt4vmb$62s$1 digitaldaemon.com>, bobef says...Kramer wrote:Nice. Looks like there's at least 2 people who want some more path functionality. <g> Here's what I have: getRoots isRoot containsRoot normPath // normalize a path; similar to the Python version // http://docs.python.org/lib/module-os.path.html isNormPath normCase // normalize the case normSep // normalize the separators for the given os join // variadic join absPath // includes a private isAbs because the one in std.path doesn't seem to // be working expandPath // similar to the Ruby version // http://www.rubycentral.com/ref/ref_c_file.html#expand_path Of course, the private isAbs would eventually be removed (and I really hope I don't need a stronger pair of glasses, because from what I've seen it isn't working -- at least on Windows; that'd be nice if I was wrong). What functions are you submitting? -Kramer P.S. - Sorry if any of the spacing is screwed up; I go through the web interface and it doesn't always play nice with the formatting.Walter, Is there an email address I can use to submit some functions for your review into std.path? I used the email that is on your N.G. postings, but I don't know if my work email stomped on my outgoing or any potential incoming. -KramerJust from curiosity, because I did the same thing today, what functions are you submitting to std.path?
Feb 17 2006
Kramer wrote:In article <dt4vmb$62s$1 digitaldaemon.com>, bobef says...I was thinking to make variadic join. It is nice not make double efforts... I want to submit: getRelativePath getFullPath (expands relative path) getDrive (works with \\networkname under windows) cleanPath (removes ..\ .\ from path) fixPath (replaces backslashes (relative to std.path.sep) with slasehes (i.e. makes / to \ under windows and vice versa under linux)Kramer wrote:Nice. Looks like there's at least 2 people who want some more path functionality. <g> Here's what I have: getRoots isRoot containsRoot normPath // normalize a path; similar to the Python version // http://docs.python.org/lib/module-os.path.html isNormPath normCase // normalize the case normSep // normalize the separators for the given os join // variadic join absPath // includes a private isAbs because the one in std.path doesn't seem to // be working expandPath // similar to the Ruby version // http://www.rubycentral.com/ref/ref_c_file.html#expand_path Of course, the private isAbs would eventually be removed (and I really hope I don't need a stronger pair of glasses, because from what I've seen it isn't working -- at least on Windows; that'd be nice if I was wrong). What functions are you submitting? -Kramer P.S. - Sorry if any of the spacing is screwed up; I go through the web interface and it doesn't always play nice with the formatting.Walter, Is there an email address I can use to submit some functions for your review into std.path? I used the email that is on your N.G. postings, but I don't know if my work email stomped on my outgoing or any potential incoming. -KramerJust from curiosity, because I did the same thing today, what functions are you submitting to std.path?
Feb 17 2006
On Sat, 18 Feb 2006 04:32:04 +1100, Kramer <Kramer_member pathlink.com> wrote:In article <dt4vmb$62s$1 digitaldaemon.com>, bobef says...Add another person. My Build utility has a number of extentions to std.path too. Maybe I should subit them as well. char[] GetCurDir(char pDrive) char[] GetInitCurDir() Bool IsRelativePath(char[] pPath) char[] CanonicalPath(char[] pPath, bool pFinal = true) char[] ReplaceExtention(char[] pFileName, char[] pNewExtention) bool MakePath(char[] pNewPath) char[] AbbreviateFileName(char[] pName, char[][] pPrefixList = null) char[] LocateFile(char[] pFileName, char[] pPathList) -- Derek Parnell Melbourne, AustraliaKramer wrote:Nice. Looks like there's at least 2 people who want some more path functionality. <g>Walter, Is there an email address I can use to submit some functions for your review into std.path? I used the email that is on your N.G. postings, but I don't know if my work email stomped on my outgoing or any potential incoming. -KramerJust from curiosity, because I did the same thing today, what functions are you submitting to std.path?
Feb 17 2006
"bobef" <bobef lessequal.com> wrote in message news:dt4vmb$62s$1 digitaldaemon.com...Just from curiosity, because I did the same thing today, what functions are you submitting to std.path?I received both of your emails about it. I guess we'll have to do a merge of the best of both! Also, for submissions to std.path, I'll need an explicit release into the public domain, as I'm making std.path public domain.
Feb 17 2006
Walter Bright wrote:Also, for submissions to std.path, I'll need an explicit release into the public domain, as I'm making std.path public domain.What is an "explicit release"?
Feb 17 2006
"bobef" <bobef lessequal.com> wrote in message news:dt55k7$bd3$1 digitaldaemon.com...Walter Bright wrote:Explicitly saying you are placing it into the public domain. Imagine you're a lawyer looking at this - the less ambiguous, the better.Also, for submissions to std.path, I'll need an explicit release into the public domain, as I'm making std.path public domain.What is an "explicit release"?
Feb 17 2006
Walter Bright wrote:"bobef" <bobef lessequal.com> wrote in message news:dt55k7$bd3$1 digitaldaemon.com...I hate this shit. Here I place this source and allow everyone to do whatever he can imagine with it, but I will not be responsible for anything. In other words 'bobef license 1.0': use without restrictions at your own risk. (by the way one line is change from the source I sent today)Walter Bright wrote:Explicitly saying you are placing it into the public domain. Imagine you're a lawyer looking at this - the less ambiguous, the better.Also, for submissions to std.path, I'll need an explicit release into the public domain, as I'm making std.path public domain.What is an "explicit release"?
Feb 17 2006
"bobef" <bobef lessequal.com> wrote in message news:dt5cbv$hvo$1 digitaldaemon.com...I hate this shit. Here I place this source and allow everyone to do whatever he can imagine with it, but I will not be responsible for anything. In other words 'bobef license 1.0': use without restrictions at your own risk.I understand completely and hate to be pedantic, but please add "I wrote this and place it into the Public Domain."
Feb 18 2006
Walter Bright wrote:"bobef" <bobef lessequal.com> wrote in message news:dt5cbv$hvo$1 digitaldaemon.com...I hate this shit. Here I place this source and allow everyone to do whatever he can imagine with it, but I will not be responsible for anything. In other words 'bobef license 1.0': use without restrictions at your own risk.I understand completely and hate to be pedantic, but please add "I wrote this and place it into the Public Domain."
Feb 18 2006
bobef wrote:version(t_Linux) { (...) writefln("\ngetFullPath tests\n"); writefln(getFullPath("\\rabbit/..\\bird")); writefln(getFullPath("\\rabbit\\cat\\..\\bird")); writefln(getFullPath("\\rabbit\\..\\bird")); writefln(getFullPath("rabbit.d")); writefln(getFullPath("rabbit\\..\\.\\bird")); writefln(getFullPath(".\\rabbit\\..\\.\\bird\\..\\"));It is not correct to remove '..' on Linux. '/a/../b' is not garanteed to be '/b', since '/a' could be a symbolic link to somewhere else on the filesystem. -- Miles < http://www.ubr.inf.br/wiki/Usuário:Miles > "Using Perl for CGI programming is like using Emacs for text editing."
Feb 24 2006
Miles wrote:bobef wrote:Never thought of that. And I think it is also not correct to replace \ with / in the Linux paths... I don't have enough Linux knowledge to solve these yet.version(t_Linux) { (...) writefln("\ngetFullPath tests\n"); writefln(getFullPath("\\rabbit/..\\bird")); writefln(getFullPath("\\rabbit\\cat\\..\\bird")); writefln(getFullPath("\\rabbit\\..\\bird")); writefln(getFullPath("rabbit.d")); writefln(getFullPath("rabbit\\..\\.\\bird")); writefln(getFullPath(".\\rabbit\\..\\.\\bird\\..\\"));It is not correct to remove '..' on Linux. '/a/../b' is not garanteed to be '/b', since '/a' could be a symbolic link to somewhere else on the filesystem.
Feb 24 2006
bobef wrote:Never thought of that. And I think it is also not correct to replace \ with / in the Linux paths... I don't have enough Linux knowledge to solve these yet.Yes, it is not correct. Every character except for '/' and '\0' is a valid character for Linux filenames. It is even possible to embed some ANSI escape sequences on filenames to make them shine on different colors on ls (this is stupid and useless, but possible). On a side note, expandTilde() is a bit off as part of the D library... the meaning we give to '~' on Linux is just as a _shell feature_, and just a convention. Otherwise, '~' is also valid as part of a filename.
Feb 24 2006
About Windows NT based systems: First, most parts of Windows accepts '/' as valid separator in file name= s. Also, the following paths are totally valid and accepted, and most of th= em = will confuse the posted code: c:\\server\share\name - don't ask - it's a hack from Win3 era still = living... \??\c:\folder\file - seen in registry, it is used by native functions \\?\c:\folder\filename - allows up to 37000 UNICODE characters in a name= . If the path is in this format it cannot be relative, cannot contain '.' = nor '..' nor '/'. \??\UNC\Server\Share - same as above but for UNC filenames The named streams syntax use ':', so 'filename:streamname" must be interpreted as file with name 'filename' containing one unnamed = = stream and one named stream called 'streamname'. Current code will accept 'filename' as drive name if I read it correctly= . If I remember correctly, Ares have a code dealing with parts of file nam= e = but I do not remeber whether it "knows" about named file streams - these wil= l = be interesting test cases for that code <hint> <hint> ;-) Regards, Todor P.S. The following names are also valid but they are variations of the examples above: \\?\Volume{d208a5aa-7554-11d9-a0af-806d6172696f}\boot.ini is a "complete" file name in the sence it describes the full path to the file and adding something like 'c:' will render it inusable. And last, paths like \\.\PhysicalDrive2 are also valid. Hope you enjoy the nice subtleness of everyone's favourite OS ;-) Please note that everyone of the paths posted are accepted by notepad.ex= e and the command interpreter cmd.exe on my machine with installed XP. Todor On Fri, 24 Feb 2006 18:09:58 +0200, Miles <_______ _______.____> wrote:bobef wrote:Never thought of that. And I think it is also not correct to replace \ with / in the Linux paths... I don't have enough Linux knowledge to solve these yet.Yes, it is not correct. Every character except for '/' and '\0' is a valid character for Linux=filenames. It is even possible to embed some ANSI escape sequences on filenames to make them shine on different colors on ls (this is stupid=and useless, but possible). On a side note, expandTilde() is a bit off as part of the D library...=the meaning we give to '~' on Linux is just as a _shell feature_, and just a convention. Otherwise, '~' is also valid as part of a filename.=
Feb 24 2006
In article <dtn34m$22sv$1 digitaldaemon.com>, Miles says...bobef wrote:Python does the same thing with it's normpath function. http://docs.python.org/lib/module-os.path.html I know it's not optimal, but I suppose until we can get some functions written to handle symbolic path expansion, it could just be noted in the docs that a getFullPath type function at the moment, does not handle symbolic links. Then at least the user is going in with both eyes open. Good points though for future improvements. -Kramerversion(t_Linux) { (...) writefln("\ngetFullPath tests\n"); writefln(getFullPath("\\rabbit/..\\bird")); writefln(getFullPath("\\rabbit\\cat\\..\\bird")); writefln(getFullPath("\\rabbit\\..\\bird")); writefln(getFullPath("rabbit.d")); writefln(getFullPath("rabbit\\..\\.\\bird")); writefln(getFullPath(".\\rabbit\\..\\.\\bird\\..\\"));It is not correct to remove '..' on Linux. '/a/../b' is not garanteed to be '/b', since '/a' could be a symbolic link to somewhere else on the filesystem. -- Miles < http://www.ubr.inf.br/wiki/Usuário:Miles > "Using Perl for CGI programming is like using Emacs for text editing."
Feb 24 2006
Written and placed into the public domain by Borislav Peev (bobef).
Feb 19 2006
In article <dt5400$a5l$1 digitaldaemon.com>, Walter Bright says..."bobef" <bobef lessequal.com> wrote in message news:dt4vmb$62s$1 digitaldaemon.com...Great! I'll be sending my source tonight (no access to it at work).Just from curiosity, because I did the same thing today, what functions are you submitting to std.path?I received both of your emails about it. I guess we'll have to do a merge of the best of both! Also, for submissions to std.path, I'll need an explicit release into the public domain, as I'm making std.path public domain.
Feb 17 2006
Walter Bright wrote:"bobef" <bobef lessequal.com> wrote in message news:dt4vmb$62s$1 digitaldaemon.com...In that line: 3D math libs anyone?? http://www.webpages.uidaho.edu/~shro8822/point_math.d http://www.webpages.uidaho.edu/~shro8822/point_lib.d If the disclaimer need fixing, just tell me what to fix it to. I have a runtime unit struct that I might put up soon also.Just from curiosity, because I did the same thing today, what functions are you submitting to std.path?I received both of your emails about it. I guess we'll have to do a merge of the best of both! Also, for submissions to std.path, I'll need an explicit release into the public domain, as I'm making std.path public domain.
Feb 17 2006