about summary refs log tree commit diff
path: root/src/libstd/rt/io/file.rs
AgeCommit message (Collapse)AuthorLines
2013-11-04Move io::file to io::fs and fns out of FileAlex Crichton-1215/+0
This renames the `file` module to `fs` because that more accurately describes its current purpose (manipulating the filesystem, not just files). Additionally, this adds an UnstableFileStat structure as a nested structure of FileStat to signify that the fields should not be depended on. The structure is currently flagged with #[unstable], but it's unlikely that it has much meaning. Closes #10241
2013-11-03Fill out the remaining functionality in io::fileAlex Crichton-525/+809
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
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-407/+386
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-10-30Make Writer::flush a no-op default methodAlex Crichton-9/+0
Closes #9126
2013-10-24Move stdin to using libuv's pipes instead of a ttyAlex Crichton-1/+1
I was seeing a lot of weird behavior with stdin behaving as a tty, and it doesn't really quite make sense, so instead this moves to using libuv's pipes instead (which make more sense for stdin specifically). This prevents piping input to rustc hanging forever.
2013-10-24Remove io::read_errorAlex Crichton-6/+6
The general idea is to remove conditions completely from I/O, so in the meantime remove the read_error condition to mean the same thing as the io_error condition.
2013-10-24Remove IoFactoryObject for ~IoFactoryAlex Crichton-64/+50
This involved changing a fair amount of code, rooted in how we access the local IoFactory instance. I added a helper method to the rtio module to access the optional local IoFactory. This is different than before in which it was assumed that a local IoFactory was *always* present. Now, a separate io_error is raised when an IoFactory is not present, yet I/O is requested.
2013-10-24Remove rt::io::supportAlex Crichton-25/+20
This removes the PathLike trait associated with this "support module". This is yet another "container of bytes" trait, so I didn't want to duplicate what already exists throughout libstd. In actuality, we're going to pass of C strings to the libuv APIs, so instead the arguments are now bound with the 'ToCStr' trait instead. Additionally, a layer of complexity was removed by immediately converting these type-generic parameters into CStrings to get handed off to libuv apis.
2013-10-23Merge remote-tracking branch 'upstream/master'Ziad Hatahet-2/+2
2013-10-22Remove thread-blocking call to `libc::stat` in `Path::stat`Ziad Hatahet-2/+2
Fixes #9958
2013-10-23Removed Unnecessary comments and white spaces #4386reedlepee-3/+0
2013-10-23Making fields in std and extra : private #4386reedlepee-2/+5
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-9/+9
Who doesn't like a massive renaming?
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-14/+14
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Replace the path module outrightKevin Ballard-21/+25
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-10Make the file::DirectoryInfo trait publicAlex Crichton-1/+1
This was just a mistake that it was hidden.
2013-09-30std: Remove usage of fmt!Alex Crichton-14/+16
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-9/+9
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-21std: add file::io::test module and ensure correct buildJeff Olson-243/+251
2013-09-21std: cleanup file::io rustdoc_ng outputJeff Olson-67/+49
2013-09-17std: whitespace clean up io::file docsJeff Olson-52/+52
2013-09-16std: docstring fixes in io::fileJeff Olson-239/+259
2013-09-16std: minor cleanup in some io_error descs in io::fileJeff Olson-2/+2
2013-09-16std: lots of docs for std::rt::io::fileJeff Olson-52/+298
i hope they don't bitrot
2013-09-16std: generlize & move io::file::suppressed_stat to io::ignore_io_errorJeff Olson-19/+7
2013-09-16std: unignore some file io tests that work on windows, nowJeff Olson-4/+0
2013-09-16std: bind uv_fs_readdir(), flesh out DirectoryInfo and docs/cleanupJeff Olson-8/+77
2013-09-16std: clean up Dir/FileInfo inheritence and flesh out Dir InfoJeff Olson-57/+121
2013-09-16std: adding file::{stat,mkdir,rmdir}, FileInfo and FileReader/FileWriterJeff Olson-89/+195
add ignores for win32 tests on previous file io stuff...
2013-09-16std/rt: in-progress file io workJeff Olson-6/+156
std: remove unneeded field from RequestData struct std: rt::uv::file - map us_fs_stat & start refactoring calls into FsRequest std: stubbing out stat calls from the top-down into uvio std: us_fs_* operations are now by-val self methods on FsRequest std: post-rebase cleanup std: add uv_fs_mkdir|rmdir + tests & minor test cleanup in rt::uv::file WORKING: fleshing out FileStat and FileInfo + tests std: reverting test files.. refactoring back and cleanup...
2013-09-15std::rt::io::file: Enable I/O tests on Win32klutzy-5/+3
Enable blocked tests which are now fixed by #9165. Closes #8810.
2013-09-06Make I/O tests use run_in_mt_newsched_task to get more multi-threaded test ↵Eric Reed-7/+7
coverage
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-7/+7
2013-08-29auto merge of #8819 : vadimcn/rust/unit-tests, r=brsonbors-0/+5
Some of the tests are failing. I've only managed to fix 'memory_map_file', the rest are up for grabs... Fixes #5261.
2013-08-29Revert "auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, ↵Brian Anderson-0/+3
r=brson" This reverts commit b8d1fa399402c71331aefd634d710004e00b73a6, reversing changes made to f22b4b169854c8a4ba86c16ee43327d6bcf94562. Conflicts: mk/rt.mk src/libuv
2013-08-28Turned off libstd unit tests that currently fail on Windows.Vadim Chugunov-0/+5
2013-08-27Implement process bindings to libuvAlex Crichton-3/+0
Closes #6436
2013-08-27librustc: Fix merge falloutPatrick Walton-2/+2
2013-08-22std: put FileMode/Access->whence-mask in uvio, open/unlink as fns in file::Jeff Olson-89/+51
2013-08-22std: slight refactor on UvFilestream seek behavior, pre-seek-refactorJeff Olson-8/+2
2013-08-22std: rename tmp file paths to go into ./tmp folder in builddirJeff Olson-7/+7
2013-08-22std: more seek testsJeff Olson-1/+71
2013-08-22std: lint appeasement for unused param in condition handlerJeff Olson-1/+1
2013-08-22std: rework file io.. support [p]read,[p]write, impl seek/tell + more testsJeff Olson-16/+124
2013-08-22std: add FileStream::unlink + more testsJeff Olson-2/+52
2013-08-22std: rt::io::file::FileStream fleshed out.. needs more work.. see extendedJeff Olson-15/+94
- change all uses of Path in fn args to &P - FileStream.read assumptions were wrong (libuv file io is non-positional) - the above will mean that we "own" Seek impl info .. should probably push it in UvFileDescriptor.. - needs more tests
2013-08-21std/extra: changing XXX to FIXME; cleanupTim Chevalier-1/+1
* Get rid of by-value-self workarounds; it works now * Remove type annotations, they're not needed anymore
2013-06-12std: unify the str -> [u8] functions as 3 methods: .as_bytes() and ↵Huon Wilson-1/+1
.as_bytes_with_null[_consume](). The first acts on &str and is not nul-terminated, the last two act on strings that are always null terminated (&'static str, ~str and @str).
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+79
This only changes the directory names; it does not change the "real" metadata names.