# unix path conversion documentation

15 messages
Open this post in threaded view
|

 Hi, I'm trying to get the test suite for xmlstarlet to work under msys, and since it deals with xpath expressions that can start with "/" I need to defeat the path conversion that msys performs. The thing is, this feature seems underdocumented: the README.rtf only says that a doubled leading slash will protect the option from conversion, but it looks like there is bit more to it: $cat args.c #include int main(int argc, char **argv) { int i; for (i = 1; i < argc; i++) { printf("arg%d: %s\n", i, argv[i]); } return 0; }$ make args CC=gcc CFLAGS='-Wall -Wextra -ansi -pedantic' gcc -Wall -Wextra -ansi -pedantic    args.c   -o args $./args /foobar arg1: C:/MinGW/msys/1.0/foobar$ ./args //foobar # we can get /foobar arg1: /foobar $./args /foo/bar arg1: C:/MinGW/msys/1.0/foo/bar$ ./args //foo/bar # how can we get /foo/bar? arg1: //foo/bar $./args '/foo;bar' # a semicolon also stops conversion!? arg1: /foo;bar Is there more detailed documentation on this feature anywhere? thanks, Noam ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe Reply | Threaded Open this post in threaded view | ## Re: unix path conversion documentation  On 20/02/11 21:05, Noam Postavsky wrote: > I need to defeat the path conversion that msys performs. The thing > is, this feature seems underdocumented: the README.rtf only says > that a doubled leading slash will protect the option from conversion, > but it looks like there is bit more to it: > > ...snip... > >$ ./args /foobar  > arg1: C:/MinGW/msys/1.0/foobar This is correct, as documented. > $./args //foobar # we can get /foobar > arg1: /foobar Also correct. >$ ./args /foo/bar  > arg1: C:/MinGW/msys/1.0/foo/bar Correct again. > $./args //foo/bar # how can we get /foo/bar? > arg1: //foo/bar This looks like a bug. I've been aware of some deficiencies in the MSYS path translation code for some time, but I can't recall having seen this particular manifestation before. Unfortunately, I don't have a Windows box here, to investigate further. >$ ./args '/foo;bar' # a semicolon also stops conversion!?  > arg1: /foo;bar Yes, because the semicolon is Windows native path list separator.  This is interpreted as a path list argument, which is already in the native Windows format, so no translation required. > Is there more detailed documentation on this feature anywhere? Short of studying the source code, none of which I am aware. -- Regards, Keith. ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe
Open this post in threaded view
|

 Keith Marshall wrote: > On 20/02/11 21:05, Noam Postavsky wrote: >> $./args //foo/bar # how can we get /foo/bar? > > arg1: //foo/bar > > This looks like a bug. I've been aware of some deficiencies in the MSYS > path translation code for some time, but I can't recall having seen this > particular manifestation before. Unfortunately, I don't have a Windows > box here, to investigate further. > This behaves properly as well as in //server/share. I don't think you can get the /foo/bar string in a native program as it is coded today. At one time //server/share became /server/share but the users complained so it was changed. -- Earnie -- http://www.for-my-kids.com------------------------------------------------------------------------------ Index, Search & Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe Reply | Threaded Open this post in threaded view | ## Re: unix path conversion documentation  On 22 February 2011 14:14, Earnie wrote: > Keith Marshall wrote: >> On 20/02/11 21:05, Noam Postavsky wrote: >>>$ ./args //foo/bar # how can we get /foo/bar? >>  > arg1: //foo/bar >> >> This looks like a bug.  I've been aware of some deficiencies in the MSYS >> path translation code for some time, but I can't recall having seen this >> particular manifestation before.  Unfortunately, I don't have a Windows >> box here, to investigate further. > > This behaves properly as well as in //server/share. Huh?  I've always understood that the correct way to specify a UNC style path, such as //server/share, to be passed from MSYS shell to any native application, is to add an extra slash, so it becomes ///server/share. You even said as much yourself, in your response to this ticket: https://sourceforge.net/tracker/?func=detail&aid=3091216&group_id=2435&atid=102435> I don't think you can get the /foo/bar string in a native program as > it is coded today. You can't.  As it is coded today, it is broken.  In fact, it has always been broken (almost by definition), since it employs heuristic analysis; any such analysis will always be broken in some circumstance.  We really need a deterministic mechanism for exempting certain parameters from path name translation. > At one time //server/share became /server/share but the users > complained so it was changed. //server/share becoming /server/share is documented behaviour.  Users complaining about that should have been directed to RTFM; changing it for the benefit of such lusers has broken it, to the detriment of everyone else. -- Regards, Keith. ------------------------------------------------------------------------------ Index, Search & Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe
Open this post in threaded view
|

## Re: unix path conversion documentation

 In reply to this post by Keith Marshall-2 Keith Marshall <[hidden email]> writes: >> Is there more detailed documentation on this feature anywhere? > > Short of studying the source code, none of which I am aware. So now that mingw.org is back online, I would like to suggest a wiki page documenting the current behaviour. I'm willing to write it up if someone can point me to the source files and create / give me permission to create the wiki page. Noam ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe
Open this post in threaded view
|

## Re: unix path conversion documentation

 Noam Postavsky wrote: > Keith Marshall <[hidden email]> writes: > >>> Is there more detailed documentation on this feature anywhere? >> >> Short of studying the source code, none of which I am aware. > > So now that mingw.org is back online, I would like to suggest a wiki > page documenting the current behaviour. I'm willing to write it up if > someone can point me to the source files and create / give me permission > to create the wiki page. > The source code can be find in CVS with instructions at the project page on SF.  I can give you permissions for editing the wiki if you give me your login name to mingw.org. -- Earnie -- http://www.for-my-kids.com------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe
Open this post in threaded view
|

## Re: unix path conversion documentation

 Earnie <[hidden email]> writes: > The source code can be find in CVS with instructions at the project page > on SF. I looked at the repository through the web interface but I couldn't find the code that implements the conversion. Also, the CVS instructions mention modulename but don't say what the possible module names are. > I can give you permissions for editing the wiki if you give me > your login name to mingw.org. It's npostavs. Noam ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe
Open this post in threaded view
|

## Re: unix path conversion documentation

 On 11/03/11 17:19, Noam Postavsky wrote: >> The source code can be find in CVS with instructions at the >> project page on SF. > > I looked at the repository through the web interface but I couldn't > find the code that implements the conversion. It isn't easy to find, (because its location isn't exactly obvious): http://mingw.cvs.sourceforge.net/viewvc/mingw/msys/rt/src/winsup/cygwin/path.cc?view=log> Also, the CVS  instructions mention modulename but don't say what > the possible module names are. If you mean the instructions here: http://sourceforge.net/scm/?type=cvs&group_id=2435(which you reach by following the Develop->Code->CVS links from the menu bar on the Project pages), they tell you that you may deduce the module names by looking here: http://mingw.cvs.sourceforge.net/viewvc/mingw/Each directory you see there represents a module; the module name is the same as the directory name. -- Regards, Keith. ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe
Open this post in threaded view
|

## Re: unix path conversion documentation

 In reply to this post by Noam Postavsky Noam Postavsky wrote: > Earnie <[hidden email]> writes: >> I can give you permissions for editing the wiki if you give me >> your login name to mingw.org. > > It's npostavs. > You can now edit the wiki. -- Earnie -- http://www.for-my-kids.com------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d_______________________________________________ MinGW-users mailing list [hidden email] This list observes the Etiquette found at http://www.mingw.org/Mailing_Lists. We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated. _______________________________________________ You may change your MinGW Account Options or unsubscribe at: https://lists.sourceforge.net/lists/listinfo/mingw-usersAlso: mailto:[hidden email]?subject=unsubscribe
Open this post in threaded view
|