summary refs log tree commit diff
path: root/src/libstd/fs.rs
AgeCommit message (Collapse)AuthorLines
2017-09-27Made `fs::copy` return the length of the main streamStephane Raux-3/+18
On Windows with the NTFS filesystem, `fs::copy` would return the sum of the lengths of all streams, which can be different from the length reported by `metadata` and thus confusing for users unaware of this NTFS peculiarity. This makes `fs::copy` return the same length `metadata` reports which is the value it used to return before PR #26751. Note that alternate streams are still copied; their length is just not included in the returned value. This change relies on the assumption that the stream with index 1 is always the main stream in the `CopyFileEx` callback. I could not find any official document confirming this but empirical testing has shown this to be true, regardless of whether the alternate stream is created before or after the main stream. Resolves #44532
2017-09-23Rollup merge of #44759 - durka:patch-43, r=steveklabnikCorey Farwell-3/+3
improve english in create_dir_all docs Just minor nitpicking.
2017-09-21improve english in create_dir_all docsAlex Burka-3/+3
2017-09-17Add test case for unix permissionsTrevor Merrifield-0/+21
2017-09-13Add note for append method in OpenOptions docsGuillaume Gomez-0/+6
2017-09-13Add missing urls for OpenOptions docsGuillaume Gomez-5/+17
2017-08-15Clarify 'writable'-changing behavior of `set_readonly`.Corey Farwell-1/+5
Fixes https://github.com/rust-lang/rust/issues/41984.
2017-08-15Clarify `readonly` method is also about being 'unwritable'.Corey Farwell-1/+1
2017-08-12Fix some typosBastien Orivel-1/+1
2017-08-10Add missing links in ReadDir docsGuillaume Gomez-5/+5
2017-08-10Add missing links on File struct docsGuillaume Gomez-2/+4
2017-07-18libstd: remove redundant & from &Path::new(...)NODA, Kai-3/+3
fn Path::new<S: AsRef ...>(s: &S) -> &Path Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-06-28Add links to the `ErrorKind` variants in errors of `open`Tobias Bucher-11/+16
2017-06-27Document possible `io::ErrorKind`s of `fs::open`Tobias Bucher-9/+25
Try to make clear that this isn't an API guarantee for now, as we likely want to refine these errors in the future, e.g. `ENOSPC` "No space left on device". CC #40322
2017-06-20Add `Read::initializer`.Steven Fackler-5/+9
This is an API that allows types to indicate that they can be passed buffers of uninitialized memory which can improve performance.
2017-05-26doc rewordingking6cong-1/+1
2017-05-08Remove need for &format!(...) or &&"" dances in `span_label` callsOliver Schneider-1/+1
2017-04-06Fix Markdown issues in the docsOliver Middleton-0/+14
* Since the switch to pulldown-cmark reference links need a blank line before the URLs. * Reference link references are not case sensitive. * Doc comments need to be indented uniformly otherwise rustdoc gets confused.
2017-04-02Improve documentation for `std::fs::DirBuilder`Peter Gerber-3/+6
2017-03-18Fix problems left in `concurrent_recursive_mkdir`Dawid Ciężarkiewicz-3/+4
Increase lifetime of `tmpdir`, and really change the length of test path.
2017-03-17Fix `create_dir_all("")`Dawid Ciężarkiewicz-0/+14
Add a test for `""` and `"."`.
2017-03-17Reorder match checks in `create_dir_all`Dawid Ciężarkiewicz-1/+1
Avoid doing `is_dir` in the fast path.
2017-03-17Fix problems found on Windows in `dir_create_all`Dawid Ciężarkiewicz-4/+3
Ignore the type of error altogether. The rationale is: it doesn't matter what was the problem if the directory is there. In the previous versions if the directory was there already we wouldn't even attempt to create it, so we wouldn't know about the problem neither. Make test path length smaller in `concurrent_recursive_mkdir` test.
2017-03-17Break line longer than 100 charactersDawid Ciężarkiewicz-1/+2
2017-03-17Add `concurrent_recursive_mkdir` testDawid Ciężarkiewicz-1/+22
2017-03-17Fix new version of `create_dir_all`Dawid Ciężarkiewicz-2/+2
It will now correctly fail on existing non-directories.
2017-03-17Fix race condition in fs::create_dir_allDavid Roundy-4/+20
It is more robust to not fail if any directory in a path was created concurrently. This change lifts rustc internal `create_dir_racy` that was created to handle such conditions to be new `create_dir_all` implementation.
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-4/+4
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-01-29Fix a few impl stability attributesOliver Middleton-1/+1
The versions show up in rustdoc.
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-2/+1
This commit applies the stabilization/deprecations of the 1.16.0 release, as tracked by the rust-lang/rust issue tracker and the final-comment-period tag. The following APIs were stabilized: * `VecDeque::truncate` * `VecDeque::resize` * `String::insert_str` * `Duration::checked_{add,sub,div,mul}` * `str::replacen` * `SocketAddr::is_ipv{4,6}` * `IpAddr::is_ipv{4,6}` * `str::repeat` * `Vec::dedup_by` * `Vec::dedup_by_key` * `Result::unwrap_or_default` * `<*const T>::wrapping_offset` * `<*mut T>::wrapping_offset` * `CommandExt::creation_flags` (on Windows) * `File::set_permissions` * `String::split_off` The following APIs were deprecated * `EnumSet` - replaced with other ecosystem abstractions, long since unstable Closes #27788 Closes #35553 Closes #35774 Closes #36436 Closes #36949 Closes #37079 Closes #37087 Closes #37516 Closes #37827 Closes #37916 Closes #37966 Closes #38080
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-55/+55
See #38644.
2017-01-22Auto merge of #39176 - CartesianDaemon:master, r=frewsxcvbors-1/+12
Use fs::symlink_metadata in doc for is_symlink fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue #39088.
2017-01-21Revert "Add link to symlink_metadata in fs::Metadata doc"Jack Vickeridge-4/+3
This reverts commit fe9f5d52a6830991609c07455b0267852d9c3545.
2017-01-20Document that `Metadata` can be obtained from `symlink_metadata`Andrea Canciani-3/+5
2017-01-20Add link to symlink_metadata in fs::Metadata docJack Vickeridge-3/+4
2017-01-20Fix formatting and links in previous doc change.Jack Vickeridge-4/+10
2017-01-19Use fs::symlink_metadata in doc for is_symlinkJack Vickeridge-1/+6
fs::metadata() follows symlinks so is_symlink() will always return false. Use symlink_metadata instead in the example in the documentation. See issue #39088.
2017-01-09Fix a couple of bad Markdown linksChris Morgan-1/+2
2016-12-26Auto merge of #38536 - retep998:flauschige-kaninchen, r=petrochenkovbors-20/+25
Fix fs tests on Windows systems with non-english locales. Fixes https://github.com/rust-lang/rust/issues/34628 r? @alexcrichton
2016-12-24Auto merge of #38443 - frewsxcv:file-docs, r=brsonbors-6/+38
Improve the API examples for `std::fs::File`. Fixes https://github.com/rust-lang/rust/issues/35875.
2016-12-22Fix fs tests on Windows systems with non-english locales.Peter Atashian-20/+25
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-1/+17
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-18Improve the API examples for `std::fs::File`.Corey Farwell-6/+38
* Separate functionality into different code blocks * Incorporate `BufReader` example * Fixes https://github.com/rust-lang/rust/issues/35875.
2016-11-22Add a method for setting permissions directly on an open file.Steven Allen-0/+53
On unix like systems, the underlying file corresponding to any given path may change at any time. This function makes it possible to set the permissions of the a file corresponding to a `File` object even if its path changes.
2016-10-16impl Debug for ReadDirDavid Henningsson-0/+1
It is good practice to implement Debug for public types, and indicating what directory you're reading seems useful. Signed-off-by: David Henningsson <diwic@ubuntu.com>
2016-10-09Implement reading and writing atomically at certain offsetsTobias Bucher-1/+125
These functions allow to read from and write to a file in one atomic action from multiple threads, avoiding the race between the seek and the read. The functions are named `{read,write}_at` on non-Windows (which don't change the file cursor), and `seek_{read,write}` on Windows (which change the file cursor).
2016-09-30Ignore various entire test modules on emscriptenBrian Anderson-50/+1
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+49
2016-09-22Implement Debug for DirEntry.Corey Farwell-0/+20
2016-08-31Rollup merge of #35786 - GuillaumeGomez:paths_doc, r=steveklabnikJonathan Turner-2/+5
Improve Path and PathBuf docs r? @steveklabnik