Re: Again: Temp user directory

From: AlanGLLoyd (alanglloyd_at_aol.com)
Date: 09/30/04


Date: 30 Sep 2004 11:47:04 GMT

In article <415bc50c$0$78753$e4fe514c@news.xs4all.nl>, "Tom de Neef"
<tdeneef@qolor.nl> writes:

>There remains an esthetic issue: its result is in the truncated format (eg
>"C:\DOCUME~1\TOMDEN~1\LOCALS~1\Temp\").
>A bit awkward to use in explanation to a user.
>Would there be a way of getting the unabridged path name ?
>And more generally: where do I start searching for the answer if I can not
>get it from you? I find Help not very helpful in this respect.
>

If you're using Win 98 or Win 2000 you can use the GetLonPathName API ...

function GetLongPathName(lpszShortPath, lpTStr : PChar;
                         cchBuffer : integer) : integer; stdcall;
                         external 'kernel32.dll' name 'GetLongPathNameA';

function GetLongPN(ShortPN : string) : string;
var
  ResLen : integer;
begin
  ResLen := MAX_PATH;
  SetLength(Result, ResLen);
  ResLen := GetLongPathName(PChar(ShortPN), PChar(Result), ResLen);
  SetLength(Result, ResLen);
end;

Alan Lloyd
alanglloyd@aol.com



Relevant Pages

  • Re: Again: Temp user directory
    ... >>A bit awkward to use in explanation to a user. ... >>Would there be a way of getting the unabridged path name? ... Yet another obvious omission in the windows.pas unit. ...
    (comp.lang.pascal.delphi.misc)
  • Re: use of backward single quote in procedure names, was: DST (summer time) offset
    ... Richard Russell wrote: ... Less awkward than EVAL, maybe, but doesn't it share the same principal ... Yes, a problem if you crunch routine names, but hugely more ... If you assign the FN names you want to be able to pass to string ...
    (comp.sys.acorn.programmer)
  • Re: Str Replace
    ... but particularly clarity of explanation. ... If searchSequence is String than *the first occurence* of this ... string will be replaced by replaceSequence. ... If searchSequence is RegExp then the matches to this RegExp ...
    (comp.lang.javascript)
  • Re: Guitar intonation problem?
    ... Thanks for your explanation of how it works. ... Therefore the string vibrations decay to micro-vibrations and as those micro-vibrations build up over time as the strings are played, causing Doppler distortion which makes the intonation appear to change. ... Energy can be converted to matter. ...
    (alt.guitar.bass)
  • Re: Regexp greediness.
    ... i guess my point is that i think it's helpful to show the string that ... explanation following an example of something not working is helpful ... Golden Rule. ... Usenet has nothing to do with anything here. ...
    (comp.lang.perl.misc)