Stebalien / tempfile

Temporary file library for rust
http://stebalien.com/projects/tempfile-rs
Apache License 2.0
1.2k stars 120 forks source link

Use `rename`/`unlink`/`etc. instead of `renameat`/`unlinkat`/etc. #247

Closed sunfishcode closed 1 year ago

sunfishcode commented 1 year ago

Rustix on Haiku doesn't support CWD, so use the non-at versions of functions, since tempfile was only ever passing CWD to them.

For link, switch to std::fs::hard_link, since the link function has platform-dependent behavior and std has code to deal with that. This should also help portability to some platforms which lack linkat.