www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Email for std.path submissions

reply Kramer <Kramer_member pathlink.com> writes:
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
parent reply bobef <bobef lessequal.com> writes:
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.
 
 -Kramer
 
 

Just from curiosity, because I did the same thing today, what functions are you submitting to std.path?
Feb 17 2006
next sibling parent reply Kramer <Kramer_member pathlink.com> writes:
In article <dt4vmb$62s$1 digitaldaemon.com>, bobef says...
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.
 
 -Kramer
 
 

Just from curiosity, because I did the same thing today, what functions are you submitting to std.path?

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.
Feb 17 2006
next sibling parent bobef <bobef lessequal.com> writes:
Kramer wrote:
 In article <dt4vmb$62s$1 digitaldaemon.com>, bobef says...
 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.

 -Kramer

are you submitting to std.path?

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.

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)
Feb 17 2006
prev sibling parent "Derek Parnell" <derek psych.ward> writes:
On Sat, 18 Feb 2006 04:32:04 +1100, Kramer <Kramer_member pathlink.com>  
wrote:

 In article <dt4vmb$62s$1 digitaldaemon.com>, bobef says...
 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.

 -Kramer

Just from curiosity, because I did the same thing today, what functions are you submitting to std.path?

Nice. Looks like there's at least 2 people who want some more path functionality. <g>

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, Australia
Feb 17 2006
prev sibling parent reply "Walter Bright" <newshound digitalmars.com> writes:
"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
next sibling parent reply bobef <bobef lessequal.com> writes:
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
parent reply "Walter Bright" <newshound digitalmars.com> writes:
"bobef" <bobef lessequal.com> wrote in message 
news:dt55k7$bd3$1 digitaldaemon.com...
 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"?

Explicitly saying you are placing it into the public domain. Imagine you're a lawyer looking at this - the less ambiguous, the better.
Feb 17 2006
parent reply bobef <bobef lessequal.com> writes:
Content-Type: text/plain; charset=windows-1251; format=flowed
Content-Transfer-Encoding: 7bit

Walter Bright wrote:
 "bobef" <bobef lessequal.com> wrote in message 
 news:dt55k7$bd3$1 digitaldaemon.com...
 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.


Explicitly saying you are placing it into the public domain. Imagine you're a lawyer looking at this - the less ambiguous, the better.

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)
Feb 17 2006
next sibling parent reply "Walter Bright" <newshound digitalmars.com> writes:
"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
parent reply bobef <bobef lessequal.com> writes:
Content-Type: text/plain; charset=windows-1251; format=flowed
Content-Transfer-Encoding: 7bit

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
next sibling parent bobef <bobef lessequal.com> writes:
Hope this do the trick...
Feb 18 2006
prev sibling parent reply Miles <_______ _______.____> writes:
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
next sibling parent reply bobef <bobef lessequal.com> writes:
Miles wrote:
 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.

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.
Feb 24 2006
parent reply Miles <_______ _______.____> writes:
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
parent "Todor Totev" <umbra.tenebris list.ru> writes:
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
prev sibling parent Kramer <Kramer_member pathlink.com> writes:
In article <dtn34m$22sv$1 digitaldaemon.com>, Miles says...
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."

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. -Kramer
Feb 24 2006
prev sibling parent bobef <bobef lessequal.com> writes:
Written and placed into the public domain by Borislav Peev (bobef).
Feb 19 2006
prev sibling next sibling parent Kramer <Kramer_member pathlink.com> writes:
In article <dt5400$a5l$1 digitaldaemon.com>, Walter Bright says...
"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.

Great! I'll be sending my source tonight (no access to it at work).
Feb 17 2006
prev sibling parent BCS <BCS_member pathlink.com> writes:
Walter Bright wrote:
 "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.

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.
Feb 17 2006