Article View: borland.public.cppbuilder.nativeapi
Article #4328Re: Clean up my filepath
From: Thorsten Kettner
Date: Wed, 15 Feb 2006 10:46
Date: Wed, 15 Feb 2006 10:46
24 lines
2245 bytes
2245 bytes
"Thorsten Kettner" wrote something like: >Convert path "C:\Dir1\Dir2\Dir3\..\..\SomeFile.ext" to >"C:\Dir1\SomeFile.ext". Thank you Stefano and Vladimir. I am not looking for functions that truncate my path to fit in a given pixel width, but I am glad though you mentioned the functions for two reasons. First: You pointed me to PathCompactPath. That made me look at shlwapi path functions. Thus I found PathCanonicalize, which is what I had been looking for. Second: I didn't know about MinimizeName and PathCompactPath and coded something alike in another project which I can replace now by a mere function call. Explanation of what I was looking for: The path "C:\Dir1\Dir2\Dir3\..\..\SomeFile.ext" means exactly the same as "C:\Dir1\SomeFile.ext", because "\.." means: go up one directory. If one interprets the path to find out where SomeFile.ext is located, it goes like this: Go to C:\, then go down to Dir1, then down to Dir2, then down to Dir3, then one dir up (to Dir2), then one dir up (to Dir1). I wanted the system to state that the path "C:\Dir1\Dir2\Dir3\..\..\SomeFile.ext" means nothing else but simply "C:\Dir1\SomeFile.ext".
Technical Details
Message-ID:
<43f31479$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<43f2e2db@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,e97a769b105ea7a X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de> Sender: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de> Reply-To: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de> Subject: Re: Clean up my filepath Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 80.85.196.94 References: <43f2e2db@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <43f31479$1@newsgroups.borland.com> Date: 15 Feb 2006 03:46:01 -0700 X-Trace: newsgroups.borland.com 1140003961 207.105.83.66 (15 Feb 2006 03:46:01 -0700) Lines: 24 Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news4.google.com!news.glorb.com!tudelft.nl!txtfeed1.tudelft.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail