Hi
I opened a file by file identifier using ZwCreateFile.
It runs just fine however file is not deleted.
I note here that if I attempt to set the FileDispositionInformation with DeleteFile TRUE
(the other delete) then the ZwSetInformationFile call is failed with
STATUS_INVALID_PARAMETER despite that I seem to have been able to open with
DELETE access.
Is this the expected behaviour of the system?
What could be the reason ?
Any help will be appreciated.
Thanks
That sounds like how I recall the system works.
The reason, in general terms, is becasue you open by id instead of name, so
you havent specified a link for the file. The delete interface works on
links, it deletes a link, and if there are zero links left, the now unlinked
file is ‘removed’.
The specifics of the implementation seem to be, well, a bit curious, as you
have observed.
Cheers
Lyndon
wrote in message news:xxxxx@ntfsd…
> Hi
> I opened a file by file identifier using ZwCreateFile.
> It runs just fine however file is not deleted.
> I note here that if I attempt to set the FileDispositionInformation with
> DeleteFile TRUE
> (the other delete) then the ZwSetInformationFile call is failed with
> STATUS_INVALID_PARAMETER despite that I seem to have been able to open
> with
> DELETE access.
>
> Is this the expected behaviour of the system?
>
> What could be the reason ?
>
> Any help will be appreciated.
>
> Thanks
>
Thanks Lyndon.
You mean to say we have to open file by filename only, to delete or rename file.
or is there any other way to resolve this issue ?
When you opened the file using id you can query its name using
ZwQueryInformationFile (it works on NTFS despite ambiguity involved) and then
use the name to reopen the file for rename/deletion.
Alexei.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@yahoo.co.in
Sent: Wednesday, March 28, 2007 2:42 AM
To: Windows File Systems Devs Interest List
Subject: RE:[ntfsd] File open by file id and File deletion failure
Thanks Lyndon.
You mean to say we have to open file by filename only, to delete or rename
file.
or is there any other way to resolve this issue ?
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@vmware.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
AFAIK for delete and rename you need to open by name. Like Alexei pointed
out if you have and ID you could open by id, query for name (if you have
appropriate privileges - search this list for “SeChangeNotifyPrivilege” more
infomation on that point!), close, open by name (so long as nobody renames
in the meantime!), and then delete or rename.
So why do you want to open by id instead of name; what is the actual problem
you are trying to solve? I only ask because there might be other ways to
approach that problem.
wrote in message news:xxxxx@ntfsd…
> Hi
> I opened a file by file identifier using ZwCreateFile.
> It runs just fine however file is not deleted.
> I note here that if I attempt to set the FileDispositionInformation with
> DeleteFile TRUE
> (the other delete) then the ZwSetInformationFile call is failed with
> STATUS_INVALID_PARAMETER despite that I seem to have been able to open
> with
> DELETE access.
>
> Is this the expected behaviour of the system?
>
> What could be the reason ?
>
> Any help will be appreciated.
>
> Thanks
>
Lyndon J Clarke wrote:
AFAIK for delete and rename you need to open by name. Like Alexei pointed
out if you have and ID you could open by id, query for name (if you have
appropriate privileges - search this list for “SeChangeNotifyPrivilege” more
infomation on that point!), close, open by name (so long as nobody renames
in the meantime!), and then delete or rename.
Hmm… could that work? A file could have the same ID but multiple
names, created by hardlinks. You wouldn’t necessarily know which one to
delete.
Tony
Hi Tony
Indeed in presence of multiple links this would delete whichever name the
system happens to return which might or might not be desired 
Cheers
Lyndon
“Tony Hoyle” wrote in message news:xxxxx@ntfsd…
> Lyndon J Clarke wrote:
>> AFAIK for delete and rename you need to open by name. Like Alexei pointed
>> out if you have and ID you could open by id, query for name (if you have
>> appropriate privileges - search this list for “SeChangeNotifyPrivilege”
>> more infomation on that point!), close, open by name (so long as nobody
>> renames in the meantime!), and then delete or rename.
>
> Hmm… could that work? A file could have the same ID but multiple names,
> created by hardlinks. You wouldn’t necessarily know which one to delete.
>
> Tony
>