Skip to content

Commit e2b2c3a

Browse files
committed
fix docs
1 parent 20ed6b5 commit e2b2c3a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

std/src/fs.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2618,7 +2618,7 @@ pub fn remove_dir_all<P: AsRef<Path>>(path: P) -> io::Result<()> {
26182618
/// # Platform-specific behavior
26192619
///
26202620
/// This function currently corresponds to the `opendir` function on Unix
2621-
/// and the `FindFirstFile` function on Windows. Advancing the iterator
2621+
/// and the `FindFirstFileEx` function on Windows. Advancing the iterator
26222622
/// currently corresponds to `readdir` on Unix and `FindNextFile` on Windows.
26232623
/// Note that, this [may change in the future][changes].
26242624
///

std/src/sys/pal/windows/fs.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl Iterator for ReadDir {
114114
fn next(&mut self) -> Option<io::Result<DirEntry>> {
115115
if self.handle.0 == c::INVALID_HANDLE_VALUE {
116116
// This iterator was initialized with an `INVALID_HANDLE_VALUE` as its handle.
117-
// Simply return `None` because this is only the case when `FindFirstFileW` in
117+
// Simply return `None` because this is only the case when `FindFirstFileExW` in
118118
// the construction of this iterator returns `ERROR_FILE_NOT_FOUND` which means
119119
// no matchhing files can be found.
120120
return None;
@@ -1071,7 +1071,7 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
10711071
first: Some(wfd),
10721072
})
10731073
} else {
1074-
// The status `ERROR_FILE_NOT_FOUND` is returned by the `FindFirstFileW` function
1074+
// The status `ERROR_FILE_NOT_FOUND` is returned by the `FindFirstFileExW` function
10751075
// if no matching files can be found, but not necessarily that the path to find the
10761076
// files in does not exist.
10771077
//
@@ -1093,7 +1093,7 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
10931093

10941094
// Just return the error constructed from the raw OS error if the above is not the case.
10951095
//
1096-
// Note: `ERROR_PATH_NOT_FOUND` would have been returned by the `FindFirstFileW` function
1096+
// Note: `ERROR_PATH_NOT_FOUND` would have been returned by the `FindFirstFileExW` function
10971097
// when the path to search in does not exist in the first place.
10981098
Err(Error::from_raw_os_error(last_error.code as i32))
10991099
}
@@ -1234,7 +1234,7 @@ fn metadata(path: &Path, reparse: ReparsePoint) -> io::Result<FileAttr> {
12341234
opts.custom_flags(c::FILE_FLAG_BACKUP_SEMANTICS | reparse.as_flag());
12351235

12361236
// Attempt to open the file normally.
1237-
// If that fails with `ERROR_SHARING_VIOLATION` then retry using `FindFirstFileW`.
1237+
// If that fails with `ERROR_SHARING_VIOLATION` then retry using `FindFirstFileExW`.
12381238
// If the fallback fails for any reason we return the original error.
12391239
match File::open(path, &opts) {
12401240
Ok(file) => file.file_attr(),
@@ -1251,7 +1251,7 @@ fn metadata(path: &Path, reparse: ReparsePoint) -> io::Result<FileAttr> {
12511251
unsafe {
12521252
let path = maybe_verbatim(path)?;
12531253

1254-
// `FindFirstFileW` accepts wildcard file names.
1254+
// `FindFirstFileExW` accepts wildcard file names.
12551255
// Fortunately wildcards are not valid file names and
12561256
// `ERROR_SHARING_VIOLATION` means the file exists (but is locked)
12571257
// therefore it's safe to assume the file name given does not
@@ -1274,7 +1274,7 @@ fn metadata(path: &Path, reparse: ReparsePoint) -> io::Result<FileAttr> {
12741274
// We no longer need the find handle.
12751275
c::FindClose(handle);
12761276

1277-
// `FindFirstFileW` reads the cached file information from the
1277+
// `FindFirstFileExW` reads the cached file information from the
12781278
// directory. The downside is that this metadata may be outdated.
12791279
let attrs = FileAttr::from(wfd);
12801280
if reparse == ReparsePoint::Follow && attrs.file_type().is_symlink() {

0 commit comments

Comments
 (0)