| Age | Commit message (Collapse) | Author | Lines |
|
Rename fs::read_string to read_to_string and stabilize
As approved in https://github.com/rust-lang/rust/issues/46588#issuecomment-377530365
Closes #46588.
|
|
|
|
|
|
Stabilize fs::read and fs::write
As discussed in https://github.com/rust-lang/rust/issues/46588#issuecomment-373956283
|
|
r=GuillaumeGomez
Remove hidden `foo` functions from doc examples; use `Termination` trait.
Fixes https://github.com/rust-lang/rust/issues/49233.
Easier to review with the white-space ignoring `?w=1` feature: https://github.com/rust-lang/rust/pull/49357/files?w=1
|
|
|
|
Fixes https://github.com/rust-lang/rust/issues/49233.
|
|
The methods on the structures `fs::FileType` and `fs::Metadata` of (respectively) `is_file`, `is_dir`, and
`is_symlink` had some ambiguity in documentation, where it was not noted whether files will pass those tests
exclusively or not. It is now written that the tests are mutually exclusive.
Fixes #48345.
|
|
|
|
|
|
Fixes #47708.
|
|
Remove 'the this' in doc comments.
|
|
|
|
Fixes https://github.com/rust-lang/rust/issues/46578.
|
|
Use File::metadata instead of fs::metadata to choose buffer size
This replaces a `stat` syscall with `fstat` or similar, which can be faster. Fixes #47519.
|
|
This replaces a `stat` syscall with `fstat` or similar, which can be
faster. Fixes #47519.
|
|
Implement libstd for CloudABI.
Though CloudABI is strongly inspired by POSIX, its absence of features that don't work well with capability-based sandboxing makes it different enough that adding bits to `sys/unix` will make things a mess. This change therefore adds CloudABI specific platform code under `sys/cloudabi`.
One of the goals of this implementation is to build as much as possible directly on top of CloudABI's system call layer, as opposed to using the C library. This is preferred, as the system call layer is supposed to be stable, whereas the C library ABI technically is not. An advantage of this approach is that it allows us to implement certain interfaces, such as mutexes and condition variables more optimally. They can be lighter than the ones provided by pthreads.
This change disables some modules that cannot realistically be implemented right now. For example, libstd's pathname abstraction is not designed with POSIX `*at()` (e.g., `openat()`) in mind. The `*at()` functions are the only set of file system APIs available on CloudABI. There is no global file system namespace, nor a process working directory. Discussions on how to port these modules over are outside the scope of this change.
|
|
There are some tests that need to be disabled on CloudABI specifically,
due to the fact that the shims cannot be built in combination with
unix::ext or windows::ext. Also improve the scoping of some imports to
suppress compiler warnings.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Before:
```rust
use std::fs::File;
use std::io::Read;
let mut bytes = Vec::new();
File::open(filename)?.read_to_end(&mut bytes)?;
do_something_with(bytes)
```
After:
```rust
use std::fs::File;
do_something_with(File::read_contents(filename)?)
```
|
|
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
|
|
improve english in create_dir_all docs
Just minor nitpicking.
|
|
|
|
|
|
|
|
|
|
Fixes https://github.com/rust-lang/rust/issues/41984.
|
|
|
|
|
|
|
|
|
|
fn Path::new<S: AsRef ...>(s: &S) -> &Path
Signed-off-by: NODA, Kai <nodakai@gmail.com>
|
|
|
|
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
|
|
This is an API that allows types to indicate that they can be passed
buffers of uninitialized memory which can improve performance.
|
|
|
|
|
|
* 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.
|
|
|
|
Increase lifetime of `tmpdir`, and really change the length of test
path.
|
|
Add a test for `""` and `"."`.
|
|
Avoid doing `is_dir` in the fast path.
|
|
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.
|
|
|
|
|