Talk:Truncate a file: Difference between revisions

m
A delete of the original file prior to rename is permissible.
(→‎Assumes unix: Is NT still POSIX compliant?)
m (A delete of the original file prior to rename is permissible.)
Line 24:
:::I don't know Microsoft Windows. If it supports truncation, then why is a rename required? Does the truncated file become disassociated with the original filename or something? Presumably, it is not just a simple open,truncate,close sequence involved here. [[User:Markhobley|Markhobley]] 19:38, 19 July 2011 (UTC)
:::::Yes, truncation is supported in the Win32 API. At issue, I thought, was the general compatibility of the rename step. I'd probably recommend leaving the temp-and-rename workaround out of it, if it's strictly truncation that's of interest. Or leave off the requirement of atomicity. Or assume that an delete step on the original file is allowed, if necessary. --[[User:Short Circuit|Michael Mol]] 20:44, 19 July 2011 (UTC)
::::::I've left the temp and rename workaround in, so that this can be implemented on systems that have no other mechanisms. A delete of the original file prior to rename is permissible. I have added that to the task description. [[User:Markhobley|Markhobley]] 20:56, 19 July 2011 (UTC)
:::Is NT still POSIX compliant? I thought that functionality was stripped out and shipped as Windows Services for UNIX, which operates under CSRSS as a different subsystem with bizarre interaction limitations. I could be wrong, of course. --[[User:Short Circuit|Michael Mol]] 20:46, 19 July 2011 (UTC)