Re: Again: Temp user directory

From: Tom de Neef (tdeneef_at_qolor.nl)
Date: 09/30/04


Date: Thu, 30 Sep 2004 19:56:31 +0200


"Tom de Neef" <tdeneef@qolor.nl> schreef in bericht
news:415bc50c$0$78753$e4fe514c@news.xs4all.nl...
> Thanks to everyone in guiding me to the GetTempPath function in the
windows
> unit.
> It does return the path of the user's temp dir and for my app it works
fine.
>
> 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 ?

In summary - having tested the various suggestions:

GetFullPathName(someFile) returns the Current Directory concatenated with
someFile.
If you offer it a full path in 8.3 format, it resturns the 8.3 format.
It is not useful to convert such a format to a full format.

FindFirst(path,searchRec) will return the name of a file in the specified
path (directory), without the path.
That doesn't help in translating the 8.3 format path to a full format path.
It is possible to use FindFirst recursively, stepping through all
directories in the path and expanding each of them. Since the filename (or
directory name) it returns is in full format. But this is not trivial.

GetLongPathName from kernel32.dll (see the response by Alan Lloyd) does
exactly what I was looking for. It returns the expanded name of an 8.3
formated path.
Alan said it would work with W98 and W2000. For me it works with XP.
(I hope this approach is not dependent on the configuration of the target
machine.)

Thanks everybody.
Tom



Relevant Pages

  • Re: format text
    ... Read my previous suggestion for expanding the spaces. ... expand them to 1.5 you could also use Format | Font | Character Spacing: ... Scale 150%. ... Word MVP FAQ site: http://word.mvps.org ...
    (microsoft.public.word.newusers)
  • Re: make muttrc invoke script for changing my_hdr
    ... I discovered that the function that handles expanding %T ... I must be going about this wrong, because obviously people use format ... strings with "set", but I can't quite follow parse_set to see how it's ... strfcpy (path, tmp->data, sizeof (path)); ...
    (comp.mail.mutt)
  • Re: Prime 2550
    ... The most common cause is the format of head 0/track 0 has been ... Expanding a little on Matt's comment, the 100004 would be an illegal ...
    (comp.sys.prime)
  • Re: Preventing Info From Scrolling ... Possible ??
    ... I wish they would work on expanding the Freeze Panes or making use of ... Floating text Box. ... My Format is already spaced for Optimized Width and ...
    (microsoft.public.excel.newusers)
  • Re: Reformat C when XP is already installed
    ... You can do a repair or reinstall.".. ... >> know that many try to format from the Command Prompt in Windows XP.. ... I don't know where this "there is no reboot in my ...
    (microsoft.public.windowsxp.hardware)