Board index » delphi » getting full file name and path from file handle

getting full file name and path from file handle

Hello,

I'm using TFileStream to write some data in a file and after I've done that,
I want to know exactly where this file was created (in case there was no
path in the filename when creating the stream). Is it possible to extract
the filename from TFileStream.Handle ?

I don't want to use ExpandFileName, because I don't trust it enough to
provide the actual file name.

Thank you,

Matej

 

Re:getting full file name and path from file handle


"Matej Kogovsek" <matej.kogov...@triglif.si> skrev i en meddelelse
news:88eers$lk15@bornews.borland.com...

Quote
> I don't want to use ExpandFileName, because I don't trust it enough to
> provide the actual file name.

Why not just provide the path yourself, before creating the file?

Finn Tolderlund

Re:getting full file name and path from file handle


Quote
In article <88eers$l...@bornews.borland.com>, Matej Kogovsek wrote:
> I'm using TFileStream to write some data in a file and after I've done that,
> I want to know exactly where this file was created (in case there was no
> path in the filename when creating the stream). Is it possible to extract
> the filename from TFileStream.Handle ?

No. If you provide no path the file should end up in the directory returned by
GetCurrentDir. But i consider it an error to not always use a full path.

Quote

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!

Sent using Virtual Access 5.00 - download your freeware copy now
http://www.atlantic-coast.com/downloads/vasetup.exe

Other Threads