-
Error messages now include the original message from
std::io::Error
by default (#60). Previously this was exposed through theError::source()
method. For example, previously a message would look like:failed to open file `file.txt`
and you would have to remember to print the source, or use a library like
anyhow
to print the full chain of source errors. The new error message includes the cause by defaultfailed to open file `file.txt`: The system cannot find the file specified. (os error 2)
Note that the original error is no longer exposed though
Error::source()
by default. If you need access to it, you can restore the previous behaviour with theexpose_original_error
feature flag. -
The
io_safety
feature flag has been removed, and this functionality is now always enabled on Rust versions which support it (1.63.0 and greater). -
Removed deprecated APIs:
File::from_options
,tokio::symlink
- Added the first line of the standard library documentation to each function's rustdocs, to make them more useful in IDEs (#50)
- Fixed the wrapper for
tokio::fs::symlink_dir()
on Windows being incorrectly namedsymlink
. The old function is now deprecated and will be removed in the next breaking release.
- Add
fs_err_try_exists
tostd::path::Path
via extension trait. This feature requires Rust 1.63 or later. (#48)
- Fixed docs.rs build
- Implement I/O safety traits (
AsFd
/AsHandle
,Into<OwnedFd>
/Into<OwnedHandle>
) for file. This feature requires Rust 1.63 or later and is gated behind theio_safety
feature flag. (#39)
- Implement
From<fs_err::File> for std::fs::File
(#38)
- Added
File::into_parts
andFile::file_mut
to provide more access to the underlyingstd::fs::File
. - Fixed some typos in documention (#33)
- Added
symlink
for unix platforms - Added
symlink_file
andsymlink_dir
for windows - Implemented os-specific extension traits for
File
std::os::unix::io::{AsRawFd, IntoRawFd}
std::os::windows::io::{AsRawHandle, IntoRawHandle}
- Added trait wrappers for
std::os::{unix, windows}::fs::FileExt
and implemented them forfs_err::File
- Implemented os-specific extension traits for
OpenOptions
- Added trait wrappers for
std::os::{unix, windows}::fs::OpenOptionsExt
and implemented them forfs_err::OpenOptions
- Added trait wrappers for
- Improved compile times by converting arguments early and forwarding only a small number of types internally. There will be a slight performance hit only in the error case.
- Reduced trait bounds on generics from
AsRef<Path> + Into<PathBuf>
to eitherAsRef<Path>
orInto<PathBuf>
, making the functions more general.
- Added
canonicalize
,hard link
,read_link
,rename
,symlink_metadata
andsoft_link
. (#25) - Added aliases to
std::path::Path
via extension trait (#26) - Added
OpenOptions
(#27) - Added
set_permissions
(#28)
- Added
metadata
. (#15)
- Added
copy
. (#7)
- Removed custom error type in favor of
std::io::Error
. (#2)
- Fixed bad documentation link in
Cargo.toml
.
- No changes from 0.1.2.
- Added
Error::cause
implementation forfs_err::Error
.
- Added wrappers for
std::fs::*
functions.
- Initial release, containing a wrapper around
std::fs::File
.