(CodeLib-Manager)
Registriert seit: 10. Jun 2002
4.648 Beiträge
Delphi XE Professional
|
Re: Dateistatus abfragen???
15. Mai 2004, 21:15
Delphi-Quellcode:
function FileInUse(FileName: string): Boolean;
var
hFileRes: HFILE;
begin
Result := False;
if not FileExists(FileName) then
Exit;
hFileRes := CreateFile(PChar(FileName),
GENERIC_READ or GENERIC_WRITE,
0,
nil,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
0);
Result := (hFileRes = INVALID_HANDLE_VALUE);
if not Result then
CloseHandle(hFileRes);
end;
Thomas
|
|
Zitat
|