about summary refs log tree commit diff
path: root/src/libstd/fs.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-05-12 18:45:00 +0000
committerbors <bors@rust-lang.org>2018-05-12 18:45:00 +0000
commitff2ac35db93a80b2de5daa4f280bf1503d62c164 (patch)
treed267bc43ba84346d4592ed77f5d2a7084d299304 /src/libstd/fs.rs
parentc0cea750a0a10a0ed5a101839e37968d87f8ef9d (diff)
parentda79ff3cc2265514483d2a5e1f4238c85baa70e9 (diff)
Auto merge of #50686 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 13 pull requests

Successful merges:

 - #50544 (Cleanup some dependencies)
 - #50545 (Made some functions in time module const)
 - #50550 (use fmt::Result where applicable)
 - #50558 (Remove all reference to DepGraph::work_products)
 - #50602 (Update canonicalize docs)
 - #50607 (Allocate Symbol strings from an arena)
 - #50613 (Migrate the toolstate update bot to rust-highfive)
 - #50624 (fs::write: Add example writing a &str)
 - #50634 (Do not silently truncate offsets for `read_at`/`write_at` on emscripten)
 - #50644 (AppVeyor: Read back trace from crash dump on failure.)
 - #50661 (Ignore non .rs files for tidy libcoretest)
 - #50663 (rustc: Allow an edition's feature on that edition)
 - #50667 (rustc: Only suggest deleting `extern crate` if it works)

Failed merges:
Diffstat (limited to 'src/libstd/fs.rs')
-rw-r--r--src/libstd/fs.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs
index 7bd1adc411a..442a0873ae0 100644
--- a/src/libstd/fs.rs
+++ b/src/libstd/fs.rs
@@ -331,6 +331,7 @@ pub fn read_to_string<P: AsRef<Path>>(path: P) -> io::Result<String> {
 ///
 /// fn main() -> std::io::Result<()> {
 ///     fs::write("foo.txt", b"Lorem ipsum")?;
+///     fs::write("bar.txt", "dolor sit")?;
 ///     Ok(())
 /// }
 /// ```
@@ -1699,8 +1700,8 @@ pub fn read_link<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
     fs_imp::readlink(path.as_ref())
 }
 
-/// Returns the canonical form of a path with all intermediate components
-/// normalized and symbolic links resolved.
+/// Returns the canonical, absolute form of a path with all intermediate
+/// components normalized and symbolic links resolved.
 ///
 /// # Platform-specific behavior
 ///
@@ -1708,7 +1709,14 @@ pub fn read_link<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
 /// and the `CreateFile` and `GetFinalPathNameByHandle` functions on Windows.
 /// Note that, this [may change in the future][changes].
 ///
+/// On Windows, this converts the path to use [extended length path][path]
+/// syntax, which allows your program to use longer path names, but means you
+/// can only join backslash-delimited paths to it, and it may be incompatible
+/// with other applications (if passed to the application on the command-line,
+/// or written to a file another application may read).
+///
 /// [changes]: ../io/index.html#platform-specific-behavior
+/// [path]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath
 ///
 /// # Errors
 ///