Talk:Truncate a file: Difference between revisions

Line 8:
::Quoting http://www.conifersystems.com/2008/10/21/windows-vs-unix-file-system-semantics/ '' '''The Windows delete and rename model is different.''' You wouldn’t know this from the Win32 APIs, but in order to delete or rename a file in Windows, you first have to open it! Once you’ve opened it can you call NtSetInformationFile with InformationClass of FileDispositionInformation or FileRenameInformation. Setting FileDispositionInformation doesn’t even delete the file; it merely enables delete-on-close for the file, and the delete-on-close request could very well be cancelled later.''
::And, as near as I can tell, you have to get rid of the association between a name and a file before you can give another file that name. --[[User:Rdm|Rdm]] 14:43, 19 July 2011 (UTC)
::: I see, you are talking about the rename part. Truncating a file on windows works not very differently from unix. But it's true that unlike on unix where filename is just a link pointing to some inode, windows files are closely tied to the names, fair point. --[[User:Ledrug|Ledrug]] 14:55, 19 July 2011 (UTC)
Anonymous user