Files
archy/core/target/debug/deps/libtempfile-6fdc997559f6b161.rmeta
T

315 lines
178 KiB
Plaintext
Raw Normal View History

2026-01-24 22:59:20 +00:00
rust
#rustc 1.93.0 (254b59607 2026-01-19)Áõ…·fÊ ¦%g--c48c539199cbc88bÁ³VOÐêùÿ²?ÑL¼§Ì±-a7a40eb546f9e2b0Áá\ƒ¦è3$|]åŒ[IÚ tæ-14b12edc9f8cd90bÁë&Gf·Ã ¬ëñq:¤»b-bb76018b1173caf6Áà 9m Ù„«ÐÒþá•cB;-030c5b0bba47cc8fÁrustc_std_workspace_coreÁÛ¹þÓ7>H%¸ÚÉ­-4b81d37a5530864dÁüÃùs<Uß7VyóHr#QÏ-c66cc7807550ce25Á miniz_oxideÁõFÖˆÚ™ª‹"ÞXzLVª-62cbc7af83058505Áadler2Á—wÉD‘嵯|6¨%Œ
+-2f171dd2394b4b62Á hashbrownÁ,ïcV¼¨ø¢:Ê\'È߈-9571ba9e0f6c7a90Árustc_std_workspace_allocÁ%¥Èxµù·¼5Ä3Bœ-aac566ad65903fa4Á
std_detectÁMmáýZ^9õ Îà§e˜÷e-2edb296e590136d8Árustc_demangleÁ@¼§VÉNb˜æ¨fHÌ+V3-53b132e4a2fa6e26Ácfg_ifÁfÝv.Å"ÒÜuPp¹ˆ¶-f76b385d7d4d7f3eÁ addr2lineÁÕú-WiúQVÓ¬
µT§5-fe25100bd73e48e4ÁgimliÁ¹xLáÇí÷‘o±Ñ8£Å-265ba9e6e4f70b3fÁobjectÁÔ³ÝzÓÿ¶ò°öM›¼òü`-9ae0d1f8ea52a318ÁmemchrÁRÎ÷׎™te~QÓ¿ØC\Ò-0bff3c8e8f4e489eÁ  –©HtGNÏ·ˆ!á-d69228d077d46f36ÁrustixÁ!Ð)ë-z3Zp=ÑFÁÔu-16db9d7493c09f76Áà M­•’µ\ÇMÏvâr¾O-93287e1189e2c543ÁerrnoÁÍk2ß6£}€æT} ê)/Â-863fc617297c3a20ÁbitflagsÁ­£à–©9ªe¿ësÆ-fe30f521014ac5dfÁ once_cellÁGÎWypAœýéñùò¬%ï-db04c746d2c5ae91ÁfastrandÁɈÓfxø'S(´Fîdó™-86594cd9da747fc4Á getrandomÁáDã>öjêH«çre;f©O-de56f0c51ca4aa4bÁ®M1XÃßÏ“¡ÂØ_ùШ-7228978f4fcb9234Á Ò¥¡9÷LÙ$@4?[AsFdÁ$ÝØwasiÁ4”¶[AsRawFdÁ<ãØ)ú
#!#[
BorrowedFdÁTìØKú
ECE[RawFdÁ,øØhú
b`b[AsHandleÁDºÇ<•[ AsRawHandleÁ\ÄÇ #%[BorrowedHandleÁtÑÇADF[ RawHandleÁLáÇ]`bwcreateÁ4þ ØlinuxÁ<í œá wpersistÁ<ä!ØLÇ!redoxÁ<Ó!œÇ!õ
tempdir_inÁTG¡5õ tempfile_inÁ\S¡"BuilderÁ<`¡9<> NUM_RETRIESÁNUM_RAND_CHARSÁdirÁ            
   tempdirÁ 
 TempDirÁª disable_cleanupÁ  new_inÁ © with_prefixÁ" with_suffixÁ$with_suffix_inÁ&&©with_prefix_inÁ))©ª  into_pathÁkeepÁÆcloseÁ0  2 4Í 6² â  impÁ9Ù:::::â ???? ? 9errorÁFFFFFFLÍFNsourceÁF IoResultExtÁPP
with_err_pathÁRR©FUUêWþW©W À[[[[[[[[[[ [
[ [ [
[[[[[[[[[[[[[ÕvplatformÁwwwwwwwwww w
w w w create_namedÁ wcreate_unlinkedÁwâ w create_unixÁŒ wreopenÁw
NOSYSÁwv[tempfileÁ[Ô
œ©[žï[ ï[¢Í[¤Ä[TempPathÁ¦ª ¦Æ[©ª ©
¬©©persist_noclobberÁ®©©©Æ© from_pathÁ²impl Into<PathBuf>Á© [µÍ[·²[¹š¹[¼[ ¾[
NamedTempFileÁÀþÀª ÀÀ[
ÄþÄÍ[ ÇþÇ[ PersistErrorÁÊþÊÊÀ[ ÎþÎÍ[
ÑþÑï[ÔþÔï[×þ×Í[ÚþÚÄ[Ý Ýçß©ÝáÝ®ãã©ÝûæÝÑèè©[ëþëª ëë
ï©ë¨ñ©ëëÆëas_fileÁë as_file_mutÁë into_fileÁëinto_temp_pathÁë
into_partsÁë
from_partsÁ[ûÅü [þþþreadÁ þ
read_vectoredÁ þ read_to_endÁ þread_to_stringÁ þ
read_exactÁˆ [Šõ Š Š  Џ ŠÓ [þwriteÁ flushÁ write_vectoredÁ  write_allÁ ÓŸ [¡»¢ ¡Í¤ ¡ß¦ ¡ú¨ ¡Óª [¬þ¬seekÁ® [°î± [³þ³as_fdÁ[þ as_raw_fdÁ[ê¹ ¹ spooledÁ¼¼¼¼¼¼¼¼¼¼ ¼
¼ ¼ ¼spooled_tempfileÁ¼spooled_tempfile_inÁË©¼cursor_to_tempfileÁ¼Î ÎçЩΠis_rolledÁÎrollÁÎset_lenÁÎ
into_innerÁμ×õ×נ׸×ӼݻÝßÝͼáîutilÁãããããããããã ãtmpnameÁî î ã
create_helperÁññ$impl FnMut(PathBuf) -> io::Result<R>Áñ ÒõõõõõõDEFAULT_TEMPDIRÁõoverride_temp_dirÁü õtemp_dirÁþ  
  
>'aÁ'bÁ prefixÁsuffixÁ˜
rand_bytesÁappendÁ permissionsÁÆÔ
 ©  
¤©¤ makeÁ§þ§ $make_inÁªþª $ª©ª F PathErrorÁ¯ª ¯errÁF²Í[PathPersistErrorÁ´´ª [·Í¼ SpooledDataÁ¹InMemoryÁº
ºì¹OnDiskÁ½
½ì¼ÀͼSpooledTempFileÁÂmax_sizeÁÂÚÂinnerÁ¼ÆÍß ò
É“&É&É
random_lenÁɯ&ÉÅ&Éí&Éû&ÉÆÒ“&Ò&ÒÍÖ“&Ö&ÖÈÚ“&Ú&Ú˜Þ“&Þ&á“&á&áÕ,
/
3
5
5
5
7
8
?
M
M
M
O



Š

Œ
Ž
Ž



£
£
£
¥
±



¸
»
½
¿
Æ
Æ
Æ
É
Ð
Ð
Ð
Ù
Ù
Ù
Ü
í
ô
õ
ö
ü









ˆ
ˆ
Š



















Ÿ
Ÿ
¡
¢
¢
¤
¦
¦
¦
¨
¨
ª
ª
®
°
±
µ
¸
¹
¹
Í
Í
Ò
Ó
Ô
Ø
Ø
Ù
Ù
Ù
Ú
Ú
Û
Û
Ü
Ü
Þ
Þ
ß
ß
ß
à
â
î
î
î
ñ
ñ
ñ
ü



˜
š

œ

ž
Ÿ
 
£
¤
§
§
ª
ª
³
³
³
¸
¸
¸
Á
Á
Á
Ç
Ç
Ç
Õ
Õ
Õ
Ù
Ý
ä
ä
Pñ±ª  Æ Bˆë«¬n)Âé,é,Ýê,‰*Ä*Êèÿp6Ãà`¾3 ¾3à`¯¯Ÿ(°ª F±¸(FÆô!”~è¶¾å`¹4Ϲ4Pê³í³î³Òï³ìð³ñ³ò³ìäs{©¶  ¡Ñ
íÓ¶neò¢ËfØ5à`´´Î(µª Îĺ¨f岇úÞ5•6ú¦¦ç§ª [¨Æ[*Ê•jsè•6å`•6Ï•6à`Ü6 Ü6ìÜ6ñÜ6ñ3ñÜ6ÛÛÖ܉*¾(9°Ò²žÞ(à`ÀÀϪ [ÃÀ[Œsµh€*mÜþñ“8ñ3à`ÊÊ£ÌÍÀ³æÝœfý¸ÒÊ8úÞ5ä8ú“8ä8å`ä8Ïä8 “8  8ÀÀϪ [ÃÀ[Œsµh€*mÜááâ‰*ǬÒ&)ß“8ßÙ9é“8éÙ9¡)“8¿(“8à`¹º»•)¼ì½¾²)¿ìrbµà`ÂÂÚ)Ãñ)¼Äڼʼn*¼,Ö~Ÿa Ô;ßÔ;éÔ;à`ÉÉò
Ì¿*ͯ&ÎÅ&Ïí&Ðû&ÑÆi‡í._c“&&Þ¾<£¾<¬â¾<ž¾<¾<ÄÉÉò
Ì¿*ͯ&ÎÅ&Ïí&Ðû&ÑÆi‡í._c882¼¦¾¦ÇÀ4²¯·´µ¦ÄÀÎÊÀ¹ÆÂÒÉ6·¦L¯¢´×ÊN¯¤´ÚÊU곞  ¦Ñ ÔÀ¹¦þÀŠ
×ÂÀ¡
ݬÀ°
á³ÀÀÖÉÚÉÞÉáÉÉñŸà`  =å` ÏPúì ßé¡)¿(Þ£¬âžÄ65536ÁèA
¹»%†;0ÐGÐGCursorÁÒG‰*ÓGposÁ8p nèÊøßAßA­âAbufÁ«<ãA¾ «<µ[<™é•E•EEGlobalÁ Ï€ûkW¬ sàç4“
¹¾%†;0•:7> F[¼ãõÉÖ,üAÛ OpenOptionsÁ\BýF PermissionsÁ\žBGioÁµBç Ý$ÈBé,
<¨C 
T±C ±<½CƒDâC Ô
\ìC œÏlùCÀÎ(„ˆD´ˆ£dšDÊçD¨D¦Š¦!„ÎD ÊŒ¾!œàD Ë‚)\õD¹ŽÚ)|‚EÂüøÍüa^ This is a library for creating temporary files and directories that are automatically deletedÁüb.+ when no longer referenced (i.e., on drop).ÁËü•]Z - Use [`tempfile()`] when you need a real [`std::fs::File`] but don't need to refer to itÁ by-path.Áü‚da - Use [`NamedTempFile::new()`] when you need a _named_ temporary file that can be refered to itsÁ path.Áüóeb - Use [`tempdir()`] when you need a temporary directory that will be recursively deleted on drop.ÁüÙda - Use [`spooled_tempfile()`] when you need an in-memory buffer that will ultimately be backed byÁü¾,) a temporary file if it gets too large.ÁëË # DesignÁüËü€WT This crate provides several approaches to creating temporary files and directories.ÁüØ`] [`tempfile()`] relies on the OS to remove the temporary file once the last handle is closed.Áü¹PM [`TempDir`] and [`NamedTempFile`] both rely on Rust destructors for cleanup.ÁŠË¼Ž ## Resource LeakingÁ¦Ëüª]Z `tempfile` will (almost) never fail to cleanup temporary resources. However `TempDir` andÁüˆb_ `NamedTempFile` will fail if their destructors don't run. This is because `tempfile` relies onÁüë[X the OS to cleanup the underlying file, while `TempDir` and `NamedTempFile` rely on rustÁüÇ _\ destructors to do so. Destructors may fail to run if the process exits through an unhandledÁü§
ZW signal interrupt (like `SIGINT`), or if the instance is declared statically (like withÁü‚ 30 [`lazy_static`]), among other possible reasons.Á Ëüº  ## Unexpected File DeletionÁÚ ËüÞ da Most operating systems periodically clean up temporary files that haven't been accessed recentlyÁüà a^ (often on the order of multiple days). This issue does not affect unnamed temporary files butÁü¥
c` can invalidate the paths associated with named temporary files on Unix-like systems because theÁü‰[X temporary file can be unlinked from the filesystem while still open and in-use. See theÁüå^[ [temporary file cleaner](#temporary-file-cleaners) section for more security implications.ÁÄË ## SecurityÁØËüÜb_ This section discusses security issues relevant to Unix-like operating systems that use sharedÁü¿a^ temporary directories by default. Importantly, it's not relevant for Windows or macOS as bothÁü¡LI operating systems use private per-user temporary directories by default.ÁîËüò_\ Applications can mitigate the issues described below by using [`env::override_temp_dir`] toÁüÒ`] change the default temporary directory but should do so if and only if default the temporaryÁü³`] directory ([`env::temp_dir`]) is unsuitable (is world readable, world writable, managed by aÁü”" temporary file cleaner, etc.).Á·Ëü» ### Temporary File CleanersÁÛËüßc` In the presence of pathological temporary file cleaner, relying on file paths is unsafe becauseÁüÃb_ a temporary file cleaner could delete the temporary file which an attacker could then replace.Á¦Ëüªeb This isn't an issue for [`tempfile`] as it doesn't rely on file paths. However, [`NamedTempFile`]Áü]Z and temporary directories _do_ rely on file paths for _some_ operations. See the securityÁüîZW documentation on the [`NamedTempFile`] and the [`TempDir`] types for more information.ÁÉË Mitigation:ÁÝËüáb_ - This is rarely an issue for short-lived files as temporary file cleaners usually only removeÁüÄVS temporary files that haven't been modified or accessed within many (10-30) days.Áü›c` - Very long lived temporary files should be placed in directories not managed by temporary fileÁ|ÿ cleaners.ÁËÔ“ ### Access PermissionsÁ®Ëü²`] Temporary _files_ created with this library are private by default on all operating systems.Áü“c` However, temporary _directories_ are created with the default permissions and will therefore beÁü÷^[ world-readable by default unless the user has changed their umask and/or default temporaryÁ directory.ÁåËÌé ### Denial of ServiceÁƒËü‡a^ If the file-name randomness ([`Builder::rand_bytes`]) is too small and/or this crate is builtÁüéb_ without the `getrandom` feature, it may be possible for an attacker to predict the random fileÁüÌ`] names chosen by this library, preventing temporary file creation by creating temporary filesÁü­ ^[ with these predicted file names. By default, this library mitigates this denial of serviceÁtŒ! attack by:Á!ËüŸ!b_ 1. Defaulting to 6 random characters per temporary file forcing an attacker to create billionsÁü‚"^[ of files before random collisions are expected (at which point you probably have largerÁŒá" problems).Áüó"a^ 2. Re-seeding the random filename generator from system randomness after 3 failed attempts toÁüÕ#b_ create temporary a file (when the `getrandom` feature is enabled as it is by default on allÁĸ$ major platforms).ÁÑ$ËÌÕ$ ## Early drop pitfallÁï$Ëüó$^[ Because `TempDir` and `NamedTempFile` rely on their destructors for cleanup, this can leadÁüÒ%b_ to an unexpected early removal of the directory/file, usually when working with APIs which areÁüµ&?< generic
```no_runÁÔ‡' use tempfile::tempdir;Áô¢' use std::process::Command;ÁÁ'ËüÅ'63 // Create a directory inside of `env::temp_dir()`.Áôü' let temp_dir = tempdir()?;Á(ËüŸ([X // Spawn the `touch` command inside the temporary directory and collect the exit statusÁüû(ZW // Note that `temp_dir` is **not** moved into `current_dir`, but passed as a referenceÁüÖ)XU let exit_status = Command::new("touch").arg("tmp").current_dir(&temp_dir).status()?;Áü¯*# assert!(exit_status.success());ÁÓ*Ëü×*" # Ok::<(), std::io::Error>(())Á<ú* ```Á+Ëü†+]Z This works because a reference to `temp_dir` is passed to `current_dir`, resulting in theÁüä+]Z destructor of `temp_dir` being run after the `Command` has finished execution. Moving theÁüÂ,\Y `TempDir` into the `current_dir` call would result in the `TempDir` being converted intoÁüŸ-\Y an internal representation, with the original value being dropped and the directory thusÁüü-63 being deleted, before the command can be executed.Á³.Ëü·.MJ The `touch` command would fail with an `No such file or directory` error.Á…/Ë|‰/ ## ExamplesÁ™/Ëü/85 Create a temporary file and write some data into it:ÁÖ/Ë<Ú/ÌwÜâ/ use tempfile::tempfile;Á¼þ/ use std::io::Write;Á0Ëüš01. // Create a file inside of `env::temp_dir()`.ÁüÌ0 let mut file = tempfile()?;Áì0Ëüð00- writeln!(file, "Brian was here. Briefly.")?;Áü¡1"¢w<Ä1ÌwÌ1ËüÐ1FC Create a named temporary file and open an independent file handle:Á—2Ë<2Ìwü£2  use tempfile::NamedTempFile;ÁüÄ2 use std::io::{Write, Read};Áä2Ëüè2*' let text = "Brian was here. Briefly.";Á“3Ëü—31î}üÉ3*' let mut file1 = NamedTempFile::new()?;Áô3Ë”ø3 // Re-open it.Áü‹4$! let mut file2 = file1.reopen()?;Á°4Ëü´40- // Write some test data to the first handle.Áüå4&# file1.write_all(text.as_bytes())?;ÁŒ5Ëü52/ // Read the test data using the second handle.ÁüÃ5  let mut buf = String::new();Áüä5$! file2.read_to_string(&mut buf)?;ÁÔ‰6 assert_eq!(buf, text);Áü¤6"¢w<Ç6ÌwÏ6ËüÓ663 Create a temporary directory and add a file to it:ÁŠ7Ë<Ž7ÌwÔ–7ÿr´±7 use std::fs::File;Á¼È7Ã}à7Ëüä76ÓsÌ›8 let dir = tempdir()?;Áµ8Ëü¹8=: let file_path = dir.path().join("my-temporary-note.txt");Áü÷8,) let mut file = File::create(file_path)?;Áü¤90Û~Õ9ËüÙ9DA // By closing the `TempDir` explicitly, we can check that it hasÁüž:B? // been deleted successfully. If we don't close it explicitly,Áüá:>; // the directory will still be deleted when `dir` goes outÁü ;A> // of scope, but we won't know whether deleting the directoryÁŒâ; // succeeded.Á|ô; drop(file);ÁŒ„< dir.close()?;Áü–<"¢w<¹<ÌwÁ<ËüÅ<$! [`tempfile()`]: fn.tempfile.htmlÁüê<" [`tempdir()`]: fn.tempdir.htmlÁü=$! [`TempDir`]: struct.TempDir.htmlÁü²=0- [`NamedTempFile`]: struct.NamedTempFile.htmlÁüã=RO [`lazy_static`]: https://github.com/rust-lang-nursery/lazy-static.rs/issues/62Á¡º> ½> ‰@ 8lÃ> Ñ>7<https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.pngÁüÓ>>$ ?8µ„—? ¨?7%https://www.rust-lang.org/favicon.icoÁüª?'$ Ñ?8¹l×? å?7https://docs.rs/tempfile/latestÁüç?!ü·>Ô F[¼ãõÉÖ!Öæ!Û÷C"ýF•D""G³D7"ç ÝJ"é,
]" 
n" ±"ƒ" Ô
¢" œÏ´"ÀÎ(Æ"´ˆ£Ø"Êçê"¦Š¦!ü" ÊŒ¾!# Ë‚) #¹ŽÚ)2#ÂÖ!Ö!Ö!´¬A\²AÐAÜÌAtÒAèA|òAæ!ü‡B#""""""<°B7"|½BJ"<ÏBÓB89ÖÛ  remove_dir_allÁt µ 
memÁšÕ ª Ä* Ýé, Þä+ ÍÏï+ ³DÔç ÑP ò
<„É ϼø´D•¤ü£ ˜$¨|~tÉqsbdÌÞWtýKüÆ'ü«>; Create a new temporary directory. Also see [`tempdir_in`].ÁêËüîOL The `tempdir` function creates a directory in the file system and returns aÁü¾QN [`TempDir`]. The directory will be automatically deleted when the `TempDir`'sÁ´ destructor is run.Á§Ë´« # Resource LeakingÁÂËüÆC@ See [the resource leaking][resource-leaking] docs on `TempDir`.ÁŠË # SecurityÁËü¡SP Temporary directories are created with the default permissions unless otherwiseÁüõUR specified via [`Builder::permissions`]. Depending on your platform, this may makeÁÄË them world-readable.ÁäË # ErrorsÁõËüù;8 If the directory can not be created, `Err` is returned.Áµ Ë # ExamplesÁÈ ËÌwÔÔ ÿr´ï ø…¼†
Ã}ž
蟢
52 // Create a directory inside of `env::temp_dir()`瓯
 let tmp_dir = tempdir()?;Áö
Ëüú
A> let file_path = tmp_dir.path().join("my-temporary-note.txt");Áü¼ 0- let mut tmp_file = File::create(file_path)?;Áüí 41 writeln!(tmp_file, "Brian was here. Briefly.")?;Á¢ Ëü¦ <9 // `tmp_dir` goes out of scope, the directory as well asÁüã '$ // `tmp_file` will be deleted here.Áœ‹
 drop(tmp_file);Á¬Ÿ
 tmp_dir.close()?;Áüµ
"¢w
Ìwà
Ëüä
$ã‹ü‰<9 [resource-leaking]: struct.TempDir.html#resource-leakingÁ<Íê³í³î³Òï³ìð³ñ³ò³ìäs{©¶¾3Þ5
üø@ü†SP Create a new temporary directory in a specific directory. Also see [`tempdir`].ÁÚËüÞLI The `tempdir_in` function creates a directory in the specified directoryÁô« and returns a [`TempDir`].ÁüÊC@ The directory will be automatically deleted when the `TempDir`sÁ´Žü–¥Ë´©¥—ÀËüÄCÏ—ˆË«šËü;ËšÙË™›ìËÌwìø use tempfile::tempdir_in;Á´–ø…¼­Ã}ÅËüÉ:7 // Create a directory inside of the current directory.Áü„# let tmp_dir = tempdir_in(".")?;Á¨Ëü¬Aáœüî0«üŸ4äÔËüØ<¬žü•'ñžœ½ Ÿ¬Ñ»Ÿüç"¢wÌwËü–$ã‹ü»<ˆ Tÿ©Ü¡©©âƒ© Šñƒ©ñ3\
ƒ©Úš')”å/ü×DA A directory in the filesystem that is automatically deleted whenÁÌœ it goes out of scope.ÁËüºDA The [`TempDir`] type creates a directory on the file system thatÁüÿ>; is deleted once it goes out of scope. At construction, theÁü¾EB `TempDir` creates a new directory with a randomly generated name.ÁËüˆGD The default constructor, [`TempDir::new()`], creates directories inÁüÐ?< the location returned by [`env::temp_dir()`], but `TempDir`ÁüEB can be configured to manage a temporary directory in any locationÁüÖ'$ by constructing with a [`Builder`].ÁþËü‚B? After creating a `TempDir`, work with the file system by doingÁüÅ@= standard [`std::fs`] file system operations on its [`Path`],Áü†GD which can be retrieved with [`TempDir::path()`]. Once the `TempDir`ÁüÎFC value is dropped, the directory at the path will be deleted, alongÁü•IF with any files and directories it contains. It is your responsibilityÁüßB? to ensure that no further file system operations are attemptedÁü¢ <9 inside the temporary directory once it has been deleted.Áß Ë´ã ¥—ú Ëüþ DA Various platform-specific conditions may cause `TempDir` to failÁüÃ!EB to delete the underlying directory. It's important to ensure thatÁü‰"?< handles (like [`File`] and [`ReadDir`]) to files inside theÁüÉ"EB directory are dropped before the `TempDir` goes out of scope. TheÁü#DA `TempDir` destructor will silently ignore any errors in deletingÁüÔ#FC the directory; to instead handle errors call [`TempDir::close()`].Á$ËüŸ$EB Note that if the program exits before the `TempDir` destructor isÁüå$DA run, such as via [`std::process::exit()`], by segfaulting, or byÁüª%B? receiving a signal like `SIGINT`, then the temporary directoryÁÄí% will not be deleted.Á†&ËtŠ&™›™&Ëü&74 Create a temporary directory with a generated name:ÁÕ&Ë<Ù&Ìw´á&ø…¼ø&Ã}Ô' use tempfile::TempDir;Á«'Ëü¯'5ó›üå'" let tmp_dir = TempDir::new()?;Áüˆ("¢w<«(Ìw³(Ëü·(;8 Create a temporary directory with a prefix in its name:Áó(Ë<÷(Ìw´ÿ(ø…¼–)Ã}Ô®) use tempfile::Builder;ÁÉ)ËüÍ)63 // Create a directory inside of `env::temp_dir()`,Áü„*,) // whose name will begin with 'example'.Áü±*>; let tmp_dir = Builder::new().prefix("
8Ù$d$9?Ñ\P:;±<*:<ƒ³D<ç:=Þ<Oä+:Jt#><7.”D!üY…íŽèø°ú°û°Ðü°ý°þ°ìHˈXêE> í¨…Ü¡ 
?ª $lû&\ÆüÍ2ž?žþC¶þCÓþCC?C Žèº‰µ?žþD¶þDÓþDD?D¾3Žè $,LØB,ÜBÞ<ä+FG,"äFIÍ)ï+FJ³D.çFK”;=-/!ü‚¹4Mæ`Mü¨8«îïð î¹4 ïÁ`Á`œÃ`è Á]Ä`BÁ]Ê­\É:•ð£‚L ¯L
Mþ ü¦¹4OÐOüÌ9ñ ñ¹4ø°ú°û°Ðü°ý°þ°ìHˈXêE> ñÏN ÖN
Oü«PQPQªâü«©â ÈPÑŽ,ÑŽ2RRR&(üÑkÙŽþÙŽPþS©TTSP©âÌ â©â© åÌl”Ì  ÷Žè
RÙŽíŽÌª wyqsüÀ/VV©âØ5 ÅŠ5WRWüökŠ5þŠ5UþX©YXYU©âƒ’ ©â© Šƒ’ƒ’Í’ Å÷Í’Žè
WØ5ƒ’Í’$ª $“rtlnýWžþZ¶þZÓþZZWZØ5ƒ’Í’Þ5Þ5ƒ’DãB$çBv›œ¦Àʹ´, ä[\Ö,Û[]Í.ï+[^fsÁ$AÇ[`$Gá[a÷C\MýF[b³D$iç[dReadÁ$o [eSeekÁ$ué[fˆD{ËI[gWriteÁ,…ß[h”“Õ[iì[jæ
¡)[lŒ ¿([m« ðJ[nÍ ,‡¾([oÝé,[qÞä+[rÒõ[sÑP[tò
É[uT§|D)ü7"<vyjmü_,bdRUBE69%(DüØ5÷ùèêÙÛÔñÎпÁT’´Ì¢§tÁ›<ÒÖ[wê šâ  šÅ Žš
 š$›# š  v…ŠŒŽÖ,Ûwx‰”$#Çwz$)áw{÷C\/ýFw|³DFçw}´#$Vãw~Ý$ké,wrenameÁ4ª ¼wunlinkÁ4² Áwƒ hard_linkÁLÈ ¥w|Ðü"ø¨ª<A\O|`ƒü—=tv^`”¿Iü×¾òóô òñ3 óýFýFþF÷CÿFìÇ ±AËyø°ú°û°Ðü°ý°þ°ìHˈXêE> ô¨…ê³í³î³Òï³ìð³ñ³ò³ìäs{©¶•:Þ5 ö
ª  open_optionsÁdû&\Ôü‰3tt­èžþ¶þÓþ ¨…ÐAü¯3wõ õñ3Õ È
Šª ü¦-» Š £8Æ  Ž ¢8ØL 7ø <›ü… ×ö öñ3Õ ¹
Ú´üî.w÷ ÷ñ3Õ 
ŒÚýŒžþ¶þÓþŒŽèÕüÈ;Çøù ø•: ùñ3Õ Ü
ŽÀª üÃS»¤ § À8Æ ¨ « ¿8Ø 7¢
<¸ü¢ múû úñ3 ûñ3•þ Ü
old_pathÁDÒnew_pathÁDã overwriteÁLôü¦-ÏŒåüˆ2Œ¨ÄÉwâZâZUãZÓZ/&†ìK 58Àü”#'lü üñ3•þ £#
  # ü¨ %üÜ:7 Create a new temporary file. Also see [`tempfile_in`].ÁËü›MJ The file will be created in the location returned by [`env::temp_dir()`].ÁéË¥˜üËü€]Z This variant is secure/reliable in the presence of a pathological temporary file cleaner.ÁÞ˴⥗ùËüýda The temporary file will be automatically removed by the OS when the last handle to it is closed.Áüâpm This doesn't rely on Rust destructors being run, so will (almost) never fail to clean up the temporary file.ÁÓË«šäËüè63 If the file can not be created, `Err` is returned.ÁŸ Ë™›² ËÌwܾ  }¼Ú Ã}ò Ëüö 1î}ü¨
¨~È
ËüÌ
0Û~üý
"¢w<  ÌwD¯ Õ
üˆ>üô RO Create a new temporary file in the specified directory. Also see [`tempfile`].ÁÇ Ë ¥˜Ú ËüÞ ]ê§ü¼
li If the temporary file isn't created in [`env::temp_dir()`] then temporary file cleaners aren't an issue.Á©Ë´­¥—ÄËüÈdò¨ü­pß©žË«š¯Ëü³6úªêË™›ýË<Ìwô‰ use tempfile::tempfile_in;Á¼¨Ã}ÀËüÄ<9 // Create a file inside of the current working directoryÁü&# let mut file = tempfile_in("./")?;Á¨Ëü¬0Û~üÝ"¢w<€Ìw\ƒ©Õ©¤© µ©
œƒ©Ú«üë)Þ5ŸüŸü©-•6Þ5žž
Ÿüö(Ü6¡ü¡ü³,•6Ü6  
¡üþ&•6£æ`£ü«8®ýþÿ ý•6 þÁ`Á`œÃ`è Á]Ä`BÁ]Ê­\É:•ÿ£‚¢ ²¢
£þ ¹üº&•6¥Ð¥üç9 •6ø°ú°û°Ðü°ý°þ°ìHˈXêE> ú¤ ñ¤
¥œöüÆA> A path to a named temporary file without an open file handle.ÁˆËüŒOL This is useful when the temporary file needs to be used by a child process,Á„Ü
for example.ÁíËüñ`] When dropped, the temporary file is deleted unless `disable_cleanup(true)` was called on theÁüÒc` builder that constructed this temporary file and/or was called on either this `TempPath` or theÁü¶?< `NamedTempFile` from which this `TempPath` was constructed.ÁDÜ6*Ê•js觨¸|$[¦¦Éì¥[¦¦l¿Ü6ª¬®°±²´üŽ%(üÓ(% Close and remove the temporary file.ÁËüˆ?< Use this if you want to detect errors in deleting the file.ÁÌË«šåËüí52 If the file cannot be deleted, `Err` is returned.Á§ Ë™› ËêrüÜ ›€!Ëü‰!%" let file = NamedTempFile::new()?;Á³!Ëü»!63 // Close the file, but keep the path to it around.Áüö!%" let path = file.into_temp_path();Á "Ëü¨"EB // By closing the `TempPath` explicitly, we can check that it hasÁüò"FC // been deleted successfully. If we don't close it explicitly, theÁü½#GD // file will still be deleted when `file` goes out of scope, but weÁü‰$63 // won't know whether deleting the file succeeded.Á”Ä$ path.close()?;ÁüÛ$"¢w<%Ìw,•%Ü6•þ©©
ª$Ÿ%ø%ªžþ«¶þ«Óþ««ª«öÿûÿüç0Uüô&2/ Persist the temporary file at the target path.Á«'Ëü³'LI If a file exists at the target path, persist will atomically replace it.Áü„(@= If this method fails, it will return `self` in the resultingÁÌÉ( [`PathPersistError`].Áç(Ëüï(FC Note: Temporary files cannot be persisted across filesystems. AlsoÁüº)>; neither the file contents nor the containing directory areÁüý)FC synchronized, so the update may not yet have reached the disk whenÁ´È* `persist` returns.Áã*Ëtë*¥˜þ*Ëü†+IF Only use this method if you're positive that a temporary file cleanerÁüÔ+KH won't have deleted your file. Otherwise, you might end up persisting anÁì¤, attacker controlled file.ÁÆ,ËdÎ,«šß,Ëüç,GD If the file cannot be moved to the new location, `Err` is returned.Á³-Ët»-™›Î-ËlÖ-êr¼è-Ã}ü„. ›€©.Ëü±.)& let mut file = NamedTempFile::new()?;Áüß.0Û~”/Ëüœ/%¼¿üÆ/&# path.persist("./saved_file.txt")?;Áü
### MacOSÁçjËüëjKH Like on Windows, temporary files are created in per-user temporary fileÁü·kFC directories by default so calling `NamedTempFile::new()` should beÁ¤þk relatively safe.Á“lËl—l
### LinuxÁ¥lËü©lMJ Unfortunately, most _Linux_ distributions don't create per-user temporaryÁü÷lOL file directories. Worse, systemd's tmpfiles daemon (a common temporary fileÁüÇmJG cleaner) will happily remove open temporary files if they haven't beenÁü’n%" modified within the last 10 days.Á¸nË´¼n¥—ÓnËü×nA> If the program exits before the `NamedTempFile` destructor isÁü™o@= run, the temporary file will not be deleted. This can happenÁüÚoKH if the process exits using [`std::process::exit()`], a segfault occurs,Áü¦pPM receiving an interrupt signal like `SIGINT` that is not handled, or by usingÁü÷pOL a statically declared `NamedTempFile` instance (like with [`lazy_static`]).ÁÇqËüËqFC Use the [`tempfile()`] function unless you need a named file path.ÁrËü–r$‹‹ü»r)& [`NamedTempFile::new()`]: #method.newÁüår/, [`NamedTempFile::new_in()`]: #method.new_inÁü•sO½ÁüåsRÉŒlÃtþÁÁ©âÊ8DÑt“8Œsµh€*mÜÂà Ñt•:tát$át[ÀÀÜ6<õt$õt[ÀÀÊ8üu'þÅÅÑ„ †u“8Æá`Æü¯u8²uŠ “8 ŠÁ`Á`œÃ`è Á]Ä`BÁ]Ê­\É:•£‚Ä ¶uÄ
ÆÊ8$·uþ ½uü§v(þÈÈÑ„ ¬v“8ÉóÉÌäv4çvŒ Œ“8 Œñ3Ç îvÇ
ÉÊ8$ïvüØw!üw:7 Error returned when persisting a temporary file fails.ÁdãwþËËÑ„Dðwä8³æÝœfý¸ÒÌÍ ðw•:¤¡xä€x The underlying IO error.Á,¥xÊÊÞ5Ôòxü»x2/ The temporary file that couldn't be persisted.Á$öxÊÊ“8ü‘y&þÏÏÑ„ –yä8Ðá`Ðü¾y8ÁyŽ ä8 ŽÁ`Á`œÃ`è Á]Ä`BÁ]Ê­\É:•£‚Î ÅyÎ
ÐÊ8$Æyþ Ìyü¶z+þÒÒÑ„ »zÞ5ÓüÓüöz,$ùzä8Þ5ÑÑ
ÓÊ8,þzüÂ{2þÕÕÑ„ Ç{“8ÖüÖü‰|3$Œ|ä8“8ÔÔ
ÖÊ8,‘|üÛ|(þØØÑ„ à|ä8Ùæ`ÙüŠ}8} ä8 Á`Á`œÃ`è Á]Ä`BÁ]Ê­\É:•£‚× ‘}×
ÙÊ8$’}þ ˜}ü”~(þÛÛÑ„ ™~ä8ÜÐÜüÃ~94Æ~ ä8ø°ú°û°Ðü°ý°þ°ìHˈXêE> úÚ Í~Ú
ÜÊ8$Î~Ä¢Þ9Þßáãæèüµ)üÁ&# Create a new named temporary file.ÁìËüô+¶Ä¤€Ët¬€¥˜¿€ËüÇ€C@ This will create a temporary file in the default temporary fileÁüJG directory (platform dependent). This has security implications on manyÁüÞ@= platforms so please read the security section of this type'sÁ”£‚ documentation.Áº‚Ëü‚ Reasons to use this method:Áæ‚Ëüî‚IF 1. The file has a short lifetime and your temporary file cleaner isÁü¼ƒ74 sane (doesn't delete recently accessed files).ÁøƒËü€„JG 2. You trust every user on your system (i.e. you are the only user).ÁÏ„ËüׄKH 3. You have disabled your system's temporary file cleaner or verifiedÁü§…@= that your system doesn't have a temporary file cleaner.Áì…Ëüô…# Reasons not to use this method:Áœ†Ëü¤†+( 1. You'll fix it later. No you won't.ÁÔ†Ëü܆LI 2. You don't care about the security of the temporary file. If none ofÁü­‡IF the "reasons to use this method" apply, referring to a temporaryÁüû‡DA file by name may allow an attacker to
```ignoreÁü•# Builder::new().tempfile_in(dir)ÁÌwÉËüÑ-* See [`NamedTempFile::new()`] for details.ÁƒËü‹)·‚ƒ©ª Ý©ààݤ© ǵ©
߃©Ú× "üï’Kü±‘IF Create a new named temporary file with the specified filename suffix.Áÿ‘Ëü‡’-…¢¹’ËüÁ’)·‚\ö’¤Óª ÝââÝÉÓ ‚“ÚÓd…“
á¤ÓÅ&4““ "üæ–}üù“IF Create a new named temporary file with the specified filename suffix,ÁüÇ” in the specified directory.Áë”ËÔó”ú ’•Ëlš•©¡ü¬•96 Builder::new().suffix(&suffix).tempfile_in(directory)Á<ê•Ìwö•Ëüþ•-…¢°–Ëü¸–)·‚t햤ӭܪ Ýä©ååäÝÉÓ ü–çÜ ÚÓdÿ–€Ý\
ã¤Ó­ÜÅ&4¦—Ú¹—?ACEüç™Kü©˜IF Create a new named temporary file with the specified filename prefix.Á÷˜Ëüÿ˜-…¢±™Ëü¹™)·‚\Ӫ ÝççÝÉÓ ú™ÚÓdý™
æ¤Ó¯&4‹š "üÞ}üñšIF Create a new named temporary file with the specified filename prefix,Áü¿› ¦ã›ËÔë›ú ŠœËl’œ©¡ü¤œ96 Builder::new().prefix(&prefix).tempfile_in(directory)Á<âœÌwîœËüöœ-…¢¨Ëü°)·‚¤Ó­Üª Ýé©êéêÝÉÓ ôçÜ …žÚÓ€Ý\ˆž
è¤Ó­Ü¯&4žžÚ±ž?ACEÄŸŸþììÑ„ ¤Ÿ“8íîïñóôõö÷øùú,.Ü»£ü¾Ÿ" Get the temporary file's path.ÁåŸËtퟥ˜€ Ëüˆ HE Referring to a temporary file's path may not be secure in all cases.ÁüÕ KH Please read the security section on the top level documentation of thisÁ¬¥¡ type for details.Á¿¡ËtÇ¡™›Ú¡Ëlâ¡êrüô¡ ›€™¢Ëü¡¢%ľË¢ËüÓ¢" println!("{:?}", file.path());Áüú¢"¢w<¡£Ìw$£ “8 ñ3ë Ç£ë
íÊ8$È£üÕ©$ü÷£(›¼¤¤Ëü¬¤?×¼ð¤Ëdø¤«š‰¥Ëü‘¥5Á½Ë¥ËtÓ¥™›æ¥Ëlî¥êrü€¦ ›€¥¦Ëü­¦%ľצËüߦJG // By closing the `NamedTempFile` explicitly, we can check that it hasÁü®§BĈüõ§:7 // the file will still be deleted when `file` goes outÁü´¨<9 // of scope, but we won't know whether deleting the fileÁŒõ¨ŸŠ”‹© file.close()?;Áü¢©"¢w<É©Ìw,Ü©“8•þëë
îÊ8$â©ü¸´Oü˪2ð«ËüŠ«L¶ÄüÛ«@‹Å¬ ¬ [`PersistError`].Áº¬Ëü¬JG **Note:** Temporary files cannot be persisted across filesystems. AlsoÁü‘­>ÏÆüÔ­F–Ç´Ÿ®äǺ®Ët®¥˜Õ®ËüÝ®IF This method persists the temporary file using its path and may not beÁü«¯DA secure in all cases. Please read the security section on the topÁüô¯1. level documentation of this type for details.Áª°Ëd²°«šðËü˰G’Ê—±ËtŸ±™›²±Ëlº±êr¼Ì±Ã}üè± ›€²Ëü•²%ľ¿²ËüDz?< let mut persisted_file = file.persist("./saved_file.txt")?;Áü‹³:7 writeln!(persisted_file, "Brian was here. Briefly.")?;Áüʳ"¢w<ñ³Ìwý³Ëü…´.+ [`PersistError`]: struct.PersistError.htmlÁ<¿´“8­Üê³í³î³Òï³ìð³ñ³ò³ìäs{©¶Ê8ä8ë©ððëçÜ Ç´€Ý\Ê´
ïÊ8­Ü$×´¤DÝ´,.ü•ÆYüƒ¸VåÎÞ¸Ëüæ¸LÏÏü·¹0- return `s
¹Cê³í³î³Òï³ìð³ñ³ò³ìäs{©¶èAÞ5þ •ëþ
Ê8$šëB ëúëžþ¶þÓþÊ8öÿ “8ü•ìQl˜ìœ “8 œ
·
IoSliceMutÁ¹ìç ˜…«a|RU„’êþ ¦ìþ
Ê8$«ìbufsÁ$±ìÀížþƒ¶þƒÓþƒƒƒÊ8öÿñëüÛíA\Þ힟 ž“8 ŸýB’êþ êíþ
Ê8$ïíBõíóîžþ¶þÓþÊ8öÿñëüŽïCt‘ï ¡  “8 ¡ÉHÉHÊHœÜ3ËÚ¢×€JÜ’êþ  ïþ
Ê8$¥ïB«ï«ðžþ¶þÓþÊ8öÿñëüÆð:TÉ𢣠¢“8 £Žê•þþ Ôðþ
ˆÊ8$ÙðBßðÖñˆžþ¶þÓþˆÊ8öÿñëüïñ"8¤¤Ù9‹¡¢¥¦§ü˜ò7$›ò¥¦ ¥Ù9 ¦Žê’êŠ  òŠ
8$¥òB«òóžþŒ¶þŒÓþŒŒŒöÿÈèüœóQlŸó§¨© §Ù9 ¨
·Ìë¹ìç ˜…«a|RU„©’êŠ ­óŠ
8$²ó­ì$¸óÃôžþ޶þŽÓþŽŽŽöÿÈèüÞôA\áôª« ªÙ9 «ýB’êŠ íôŠ
8$òôBøôòõžþ¶þÓþöÿÈèüöCtö¬­ ¬Ù9 ­­ð’êŠ ŸöŠ
8$¤öBªö¦÷žþ¶þÓþöÿÈèüÁ÷:TÄ÷®¯ ®Ù9 ¯Žê•þŠ Ï÷Š
8$Ô÷BÚ÷³øžþ¶þÓþöÿÈèüÌø)þÑ„ ÑøßÊ8,Ôø“8—ŸàäáåçŸOQüüø4,ÿø°± °“8 ±Žê’ê …ù
Ê8$ŠùBùçùžþ˜¶þ˜Óþ˜˜˜Ê8öÿñëüú%,’ú² ²“8•þ ˜ú
Ê8$úèúžþš¶þšÓþšššÊ8öÿñëüƒûKt†û³´µ ³“8 ´
ÀIÀIÁIIoSliceÁÃIìç Xm]ƒbE µ’ê •û
Ê8$šû­ì$ û©üžþœ¶þœÓþœœœÊ8öÿñëüÄü5LÇü· “8 ·Žê•þ Ñü
Ê8$ÖüBÜüÎýžþž¶þžÓþžžžÊ8öÿñëüéýBLìý¸¹ ¸“8–½–½ ArgumentsÁ˜½templateÁÁ]™½þÁ]¤í¤>ÜIšÐ¹•þ öý
ŸÊ8$ûýÍþ€ÿŸžþ ¶þ Óþ  Ÿ Ê8öÿñëü™ÿ#8ººÙ9¢¤¦¨ªàäáå窦¤¢¨üÃÿ4,Æÿ»¼ »Ù9 ¼Žê’ê¡ Ìÿ¡
¢8$ÑÿB×ÿª€¢žþ£¶þ£Óþ££¢£öÿÈèüÒ€%,Õ€½ ½Ù9•þ¡ Û€¡
¤8$à€§¤žþ¥¶þ¥Óþ¥¥¤¥öÿÈèüÂK¾¿À ¾Ù9 ¿
ÀIÀIÁIì€ÃIìç Xm]ƒbE À’ê¡ Ô¡
¦8­ì䂦žþ§¶þ§Óþ§§¦§öÿÈèüÿ‚5L‚ƒÁ ÁÙ9 ÂŽê•þ¡ Œƒ¡
¨8$‘ƒB—ƒëƒ¨žþ©¶þ©Óþ©©¨©öÿÈèü†„BL‰„ÃÄ ÃÙ9–½–½Ë„˜½Þ„Á]™½þÁ]¤í¤>ÜIšÐÄ•þ¡ “„¡
ª8$˜„Íž„ÿ„ªžþ«¶þ«Óþ««ª«öÿÈèü˜…'þ­­Ñ„ éÊ8$ …“8®ê®#%üÆ…4$É…Å Å“8ËIÌIÍIStartÁÎIìÏIÐIEndÁÑIìÒIÓICurrentÁÔIìÅäßùU7ê³í³î³Òï³ìð³ñ³ò³ìäs{©¶Þ5¬ Î…¬