Re: Again: Temp user directory
From: Tom de Neef (tdeneef_at_qolor.nl)
Date: 09/30/04
- Next message: Maarten Wiltink: "Re: Again: Temp user directory"
- Previous message: Rob Kennedy: "Re: Again: Temp user directory"
- In reply to: Tom de Neef: "Again: Temp user directory"
- Next in thread: Maarten Wiltink: "Re: Again: Temp user directory"
- Reply: Maarten Wiltink: "Re: Again: Temp user directory"
- Reply:(deleted message) L D Blake: "Re: Again: Temp user directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Maarten Wiltink: "Re: Again: Temp user directory"
- Previous message: Rob Kennedy: "Re: Again: Temp user directory"
- In reply to: Tom de Neef: "Again: Temp user directory"
- Next in thread: Maarten Wiltink: "Re: Again: Temp user directory"
- Reply: Maarten Wiltink: "Re: Again: Temp user directory"
- Reply:(deleted message) L D Blake: "Re: Again: Temp user directory"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|