diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-29 23:31:07 -0700 | 
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-11-03 15:15:42 -0800 | 
| commit | f19d0833625c382c5d0a8868924cd4620335e659 (patch) | |
| tree | 9d4d67c3f845aa4f2596c6db94f9c883ab1dd696 /src/librustpkg/source_control.rs | |
| parent | 9c1851019f1ef9511fa8731b8f1acb0796d1e97f (diff) | |
| download | rust-f19d0833625c382c5d0a8868924cd4620335e659.tar.gz rust-f19d0833625c382c5d0a8868924cd4620335e659.zip | |
Fill out the remaining functionality in io::file
This adds bindings to the remaining functions provided by libuv, all of which are useful operations on files which need to get exposed somehow. Some highlights: * Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type * Moved all file-related methods to be static methods under `File` * All directory related methods are still top-level functions * Created `io::FilePermission` types (backed by u32) that are what you'd expect * Created `io::FileType` and refactored `FileStat` to use FileType and FilePermission * Removed the expanding matrix of `FileMode` operations. The mode of reading a file will not have the O_CREAT flag, but a write mode will always have the O_CREAT flag. Closes #10130 Closes #10131 Closes #10121
Diffstat (limited to 'src/librustpkg/source_control.rs')
| -rw-r--r-- | src/librustpkg/source_control.rs | 9 | 
1 files changed, 4 insertions, 5 deletions
| diff --git a/src/librustpkg/source_control.rs b/src/librustpkg/source_control.rs index a0e50ff0f9e..e5d1c9b597f 100644 --- a/src/librustpkg/source_control.rs +++ b/src/librustpkg/source_control.rs @@ -96,12 +96,11 @@ pub enum CloneResult { pub fn make_read_only(target: &Path) { // Now, make all the files in the target dir read-only - do file::walk_dir(target) |p| { + for p in file::walk_dir(target) { if !p.is_dir() { - assert!(chmod_read_only(p)); - }; - true - }; + assert!(chmod_read_only(&p)); + } + } } /// Source can be either a URL or a local file path. | 
