summary refs log tree commit diff
path: root/src/libstd/io/fs.rs
AgeCommit message (Collapse)AuthorLines
2014-03-27Fix fallout of removing default boundsAlex Crichton-1/+2
This is all purely fallout of getting the previous commit to compile.
2014-03-24comm: Implement synchronous channelsAlex Crichton-2/+2
This commit contains an implementation of synchronous, bounded channels for Rust. This is an implementation of the proposal made last January [1]. These channels are built on mutexes, and currently focus on a working implementation rather than speed. Receivers for sync channels have select() implemented for them, but there is currently no implementation of select() for sync senders. Rust will continue to provide both synchronous and asynchronous channels as part of the standard distribution, there is no intent to remove asynchronous channels. This flavor of channels is meant to provide an alternative to asynchronous channels because like green tasks, asynchronous channels are not appropriate for all situations. [1] - https://mail.mozilla.org/pipermail/rust-dev/2014-January/007924.html
2014-03-23This commit cleans up a few test warningsSteven Stewart-Gallus-2/+2
2014-03-20rename std::vec_ng -> std::vecDaniel Micay-1/+1
Closes #12771
2014-03-20rename std::vec -> std::sliceDaniel Micay-1/+1
Closes #12702
2014-03-10fs: units tests for mkdir_recusive and rmdir_recursiveLaurent Bonnans-0/+26
The rmdir test is blocked by #12795 on windows.
2014-03-10fs: use an iterative algorithm for 'rmdir_recursive'Laurent Bonnans-8/+41
For now, the windows version uses stat, just as before. We should switch back to lstat as soon as #12795 is closed.
2014-03-10fs: use an iterative algorithm for 'mkdir_recursive'Laurent Bonnans-3/+18
as requested in #6109
2014-03-06fix typos with with repeated words, just like this sentence.Kang Seonghoon-1/+1
2014-02-27rustc: Use libnative for the compilerAlex Crichton-1/+1
The compiler itself doesn't necessarily need any features of green threading such as spawning tasks and lots of I/O, so libnative is slightly more appropriate for rustc to use itself. This should also help the rusti bot which is currently incompatible with libuv.
2014-02-27std: Small cleanup and test improvementAlex Crichton-132/+155
This weeds out a bunch of warnings building stdtest on windows, and it also adds a check! macro to the io::fs tests to help diagnose errors that are cropping up on windows platforms as well. cc #12516
2014-02-24Correctly ignore some tests on windowsAlex Crichton-3/+2
These two tests are notoriously flaky on the windows bots right now, so I'm ignoring them until I can investigate them some more. The truncate_works test has been flaky for quite some time, but it has gotten much worse recently. The test_exists test has been flaky since the recent std::run rewrite landed. Finally, the "unix pipe" test failure is a recent discovery on the try bots. I haven't seen this failing much, but better safe than sorry! cc #12516
2014-02-23Roll std::run into std::io::processAlex Crichton-0/+1
The std::run module is a relic from a standard library long since past, and there's not much use to having two modules to execute processes with where one is slightly more convenient. This commit merges the two modules, moving lots of functionality from std::run into std::io::process and then deleting std::run. New things you can find in std::io::process are: * Process::new() now only takes prog/args * Process::configure() takes a ProcessConfig * Process::status() is the same as run::process_status * Process::output() is the same as run::process_output * I/O for spawned tasks is now defaulted to captured in pipes instead of ignored * Process::kill() was added (plus an associated green/native implementation) * Process::wait_with_output() is the same as the old finish_with_output() * destroy() is now signal_exit() * force_destroy() is now signal_kill() Closes #2625 Closes #10016
2014-02-20Mass rename if_ok! to try!Alex Crichton-11/+11
This "bubble up an error" macro was originally named if_ok! in order to get it landed, but after the fact it was discovered that this name is not exactly desirable. The name `if_ok!` isn't immediately clear that is has much to do with error handling, and it doesn't look fantastic in all contexts (if if_ok!(...) {}). In general, the agreed opinion about `if_ok!` is that is came in as subpar. The name `try!` is more invocative of error handling, it's shorter by 2 letters, and it looks fitting in almost all circumstances. One concern about the word `try!` is that it's too invocative of exceptions, but the belief is that this will be overcome with documentation and examples. Close #12037
2014-02-11Move replace and swap to std::mem. Get rid of std::utilEdward Wang-1/+0
Also move Void to std::any, move drop to std::mem and reexport in prelude.
2014-02-03std: Fixing all documentationAlex Crichton-96/+68
* Stop referencing io_error * Start changing "Failure" sections to "Error" sections * Update all doc examples to work.
2014-02-03std: Fix tests with io_error usageAlex Crichton-138/+128
2014-02-03std: Remove io::io_errorAlex Crichton-188/+171
* All I/O now returns IoResult<T> = Result<T, IoError> * All formatting traits now return fmt::Result = IoResult<()> * The if_ok!() macro was added to libstd
2014-01-29Flag Result as #[must_use] and deal with fallout.Alex Crichton-3/+3
2014-01-21[std::str] Rename from_utf8_owned_opt() to from_utf8_owned(), drop the old ↵Simon Sapin-1/+1
from_utf8_owned() behavior
2014-01-21[std::str] Rename from_utf8_opt() to from_utf8(), drop the old from_utf8() ↵Simon Sapin-7/+7
behavior
2014-01-21[std::vec] Rename .shift_opt() to .shift(), drop the old .shift() behaviorSimon Sapin-1/+1
2014-01-18Rename iterators for consistencyPalmer Cox-4/+4
Rename existing iterators to get rid of the Iterator suffix and to give them names that better describe the things being iterated over.
2014-01-09Remove eof() from io::ReaderAlex Crichton-2/+8
2014-01-04Don't allow newtype structs to be dereferenced. #6246Brian Anderson-6/+19
2013-12-24std: Get stdtest all passing againAlex Crichton-56/+31
This commit brings the library up-to-date in order to get all tests passing again
2013-12-24std: Expose that LocalIo may not always be availableAlex Crichton-37/+29
It is not the case that all programs will always be able to acquire an instance of the LocalIo borrow, so this commit exposes this limitation by returning Option<LocalIo> from LocalIo::borrow(). At the same time, a helper method LocalIo::maybe_raise() has been added in order to encapsulate the functionality of raising on io_error if there is on local I/O available.
2013-12-15std: fix spelling in docs.Huon Wilson-7/+7
2013-12-10librustuv: Change `with_local_io` to use RAII.Patrick Walton-21/+19
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-24/+24
This reverts commit c54427ddfbbab41a39d14f2b1dc4f080cbc2d41b. Leave the #[ignores] in that were added to rustpkg tests. Conflicts: src/librustc/driver/driver.rs src/librustc/metadata/creader.rs
2013-12-04std::str: s/from_utf8_slice/from_utf8/, to make the basic case shorter.Huon Wilson-7/+7
2013-12-04std::str: remove from_utf8.Huon Wilson-21/+18
This function had type &[u8] -> ~str, i.e. it allocates a string internally, even though the non-allocating version that take &[u8] -> &str and ~[u8] -> ~str are all that is necessary in most circumstances.
2013-12-03Move std::util::ignore to std::prelude::dropSteven Fackler-2/+2
It's a more fitting name for the most common use case of this function.
2013-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-24/+24
2013-11-28Register new snapshotsAlex Crichton-18/+18
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-43/+25
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-2/+2
2013-11-19Implement more native file I/OAlex Crichton-157/+160
This implements a fair amount of the unimpl() functionality in io::native relating to filesystem operations. I've also modified all io::fs tests to run in both a native and uv environment (so everything is actually tested). There are a two bits of remaining functionality which I was unable to get working: * change_file_times on windows * lstat on windows I think that change_file_times may just need a better interface, but lstat has a large implementation in libuv which I didn't want to tackle trying to copy.
2013-11-11Move std::rt::io to std::ioAlex Crichton-0/+1289