Wow!
That wasn’t what I was guessing. That means since Win32
CREATE_ALWAYS maps to OVERWRITE_IF that CREATE_ALWAYS
doesn’t actually always create… it either creates the
file or truncates an existing file.
Talk about a misnomer…
Well, let me make double sure I understand what my behavior
should be… now that I’ve thought about it this would be
a better way to ask the question in the first place:
FILE_SUPERSEDE
use AllocationSize, FileAttributes, FILE_DIRECTORY_FILE,
FILE_NON_DIRECTORY_FILE. The file is a new file.
FILE_OPEN
Never uses AllocationSize, etc. The file is an existing
file.
FILE_CREATE
use AllocationSize, etc.
FILE_OPEN_IF
use AllocationSize, etc. only if the file doesn’t previously
exist.
FILE_OVERWRITE
Always use AllocationSize, but do not apply FileAttributes
and FILE_DIRECTORY_FILE/FILE_NON_DIRECTORY_FILE must match
existing file. The file is not a new file, and the object-id
of the file does not change.
Or wait… can you OVERWRITE a directory? How about an
empty directory?
Or should FileAttributes be applied also?
FILE_OVERWRITE_IF
If the file exists, same as FILE_OVERWRITE; else same as
FILE_CREATE.
Thanks,
Tony Mason wrote:
Supersede destroys the attributes AND data of the file, while overwrite
only destroys the data. For example, you can supersede a file and have
it be a directory when the operation is done.
There is no Win32 equivalent for this.
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Joseph Galbraith
Sent: Wednesday, November 17, 2004 8:44 PM
To: ntfsd redirect
Subject: [ntfsd] CreateDisposition meaning…
The documentation seems a little vague on the
differences between some of the create dispositions.
I was hoping someone could help me make sure I understand
these correctly.
FILE_SUPERSEDE
I’m not quite sure how this is different than
FILE_OVERWRITE_IF ?
Does this have a WIN32 equivelant?
FILE_OVERWRITE
Does this actually create a new file, or just overwrite the
contents?
In otherwords, does this reset the file attributes? Does the
new file get a new object id?
Thanks,
Joseph
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com
Questions? First check the IFS FAQ at https://www.osronline.com/article.cfm?id=17
You are currently subscribed to ntfsd as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com