Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Trivia

Wiki Markup
Invoking {{remove()}} on an open file is [implementation-defined|BB. Definitions#implementation-defined behavior]. Removing an open file is sometimes recommended to hide the names of temporary files that may prone to attack (see \[[TMP30-C. Temporary files must be created with unique and unpredictable file names]\]). 

In cases when an open file needs to be removed, a more strongly defined function, such as the POSIX unlink() function, should be considered. To be strictly conforming and portable, remove() should not be called on an open file.

...

Wiki Markup
This compliant solution uses the POSIX {{unlink()}} function to remove the file.  The {{unlink()}} function  is guaranteed  to unlink the file from the file system hierarchy but keep the file on disk until all open instances of the fiefile are closed) is used \[[Open Group 04|AA. C References#Open Group 04]\].

...