Article View: borland.public.cppbuilder.nativeapi
Article #9859Re: Compressing a long path
From: Bob Gonder
Date: Fri, 11 Jun 2004 15:51
Date: Fri, 11 Jun 2004 15:51
19 lines
1518 bytes
1518 bytes
JD wrote: > >Is there an API which will compress a long path to something >like: > > "C:\Program Files\...\LastFolderName" There's one to make it C:\Progra~1\etc But I don't think there's one for what you want (unless there's one in VCL) But you can write your own, it's simply enough. Something along the lines of if( number of slashes > 3 ) midpoint = strchr(strchr(original,'\\')+1,'\\') strcpyn( final, original, (midpoint-original)) strcat(strcat(final,"..."), strrchr(original,'\\')
Technical Details
Message-ID:
<hekjc09o8mt73ic8gpevsa88r4hja6kvn7@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40c9aa76$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,69f761a2b482ea47 X-Google-Attributes: gid10cc67,public From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Compressing a long path Date: Fri, 11 Jun 2004 08:51:06 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <hekjc09o8mt73ic8gpevsa88r4hja6kvn7@4ax.com> References: <40c9aa76$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 65.173.66.53 X-Trace: newsgroups.borland.com 1086969065 65.173.66.53 (11 Jun 2004 08:51:05 -0700) Lines: 21 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!irazu.switch.ch!switch.ch!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail