Skip to content

Commit 3718075

Browse files
committed
doc: remove incorrect documentation about windows and open files
My knowledge here is clearly out of date.
1 parent 461369f commit 3718075

File tree

1 file changed

+3
-18
lines changed

1 file changed

+3
-18
lines changed

src/file/mod.rs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -399,35 +399,20 @@ impl AsRef<OsStr> for TempPath {
399399
///
400400
/// ### Windows
401401
///
402-
/// On Windows, open files _can't_ be deleted. This removes most of the concerns
403-
/// around temporary file cleaners.
404-
///
405-
/// Furthermore, temporary files are, by default, created in per-user temporary
402+
/// On Windows, temporary files are, by default, created in per-user temporary
406403
/// file directories so only an application running as the same user would be
407404
/// able to interfere (which they could do anyways). However, an application
408405
/// running as the same user can still _accidentally_ re-create deleted
409406
/// temporary files if the number of random bytes in the temporary file name is
410407
/// too small.
411408
///
412-
/// So, the only real concern on Windows is:
413-
///
414-
/// 1. Opening a named temporary file in a world-writable directory.
415-
/// 2. Using the `into_temp_path()` and/or `into_parts()` APIs to close the file
416-
/// handle without deleting the underlying file.
417-
/// 3. Continuing to use the file by path.
418-
///
419-
/// ### UNIX
420-
///
421-
/// Unlike on Windows, UNIX (and UNIX like) systems allow open files to be
422-
/// "unlinked" (deleted).
423-
///
424-
/// #### MacOS
409+
/// ### MacOS
425410
///
426411
/// Like on Windows, temporary files are created in per-user temporary file
427412
/// directories by default so calling `NamedTempFile::new()` should be
428413
/// relatively safe.
429414
///
430-
/// #### Linux
415+
/// ### Linux
431416
///
432417
/// Unfortunately, most _Linux_ distributions don't create per-user temporary
433418
/// file directories. Worse, systemd's tmpfiles daemon (a common temporary file

0 commit comments

Comments
 (0)