Does file exist

Hi

It would appear that the STATUS_NOT_A_DIRECTORY is because I open the file
for delete but do not delete it. I am using this to see if the file exists
on the disk, is there a better way of finding out if a file exists on the
disk apart from opening it from within a filter driver ?

TTFN
Paul


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Paul:

I think, the best way to check if a file exists is to open it with:
DesiredAccess = SYNCHRONIZE
Action = FILE_OPEN
Share = FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE
then analyze status returned from ZwCreateFile and:
if( (status == STATUS_OBJECT_NAME_NOT_FOUND) ||
(IoStatus.Information == FILE_DOES_NOT_EXIST) ||
(status == STATUS_OBJECT_PATH_NOT_FOUND) )
then file doesn’t exist.
At least, that’s what I’m using to check file existance. It’s faster then
opening a dir and then
perform search on the file.

Regards,

Vladimir

-----Original Message-----
From: Paul Delivett [mailto:xxxxx@Carraig.co.uk]
Sent: Monday, February 26, 2001 2:39 AM
To: File Systems Developers
Subject: [ntfsd] Does file exist

Hi

It would appear that the STATUS_NOT_A_DIRECTORY is because I open the file
for delete but do not delete it. I am using this to see if the file exists
on the disk, is there a better way of finding out if a file exists on the
disk apart from opening it from within a filter driver ?

TTFN
Paul


You are currently subscribed to ntfsd as: xxxxx@Starbase.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com