summary refs log tree commit diff
path: root/src/libstd/os.rs
AgeCommit message (Collapse)AuthorLines
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-3/+1
2014-01-07Fix remaining cases of leaking importsAlex Crichton-3/+5
2013-12-24std: Stop reexporting the contents of 'mod consts'Alex Crichton-3/+1
This prevents usage of the win32 utf-16 helper functions from outside of libstd. Closes #9053
2013-12-24std: Move management of the exit code to std::osAlex Crichton-5/+15
Previously this functionality was located in std::rt::util, but there's no real reason for it to be located in there.
2013-12-19std::str: replace .as_imm_buf with .as_ptr.Huon Wilson-6/+4
2013-12-19std::vec: remove .as_muf_buf, replaced by .as_mut_ptr & .len.Huon Wilson-49/+36
2013-12-19std::vec: remove .as_imm_buf, replaced by .as_ptr & .len.Huon Wilson-1/+1
There's no need for the restrictions of a closure with the above methods.
2013-12-15std::vec: convert to(_mut)_ptr to as_... methods on &[] and &mut [].Huon Wilson-2/+2
2013-12-15Move std::{str,vec}::raw::set_len to an unsafe method on Owned{Vector,Str}.Huon Wilson-2/+2
2013-12-10librustpkg: Make `io::ignore_io_error()` use RAII; remove a few morePatrick Walton-1/+3
cells.
2013-12-08Remove dead codesKiet Tran-10/+2
2013-12-04Revert "libstd: Change `Path::new` to `Path::init`."Kevin Ballard-17/+17
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-11-29libstd: Change `Path::new` to `Path::init`.Patrick Walton-17/+17
2013-11-28Register new snapshotsAlex Crichton-1/+1
2013-11-26libstd: Remove all non-`proc` uses of `do` from libstdPatrick Walton-67/+61
2013-11-26Removed unneccessary `_iter` suffixes from various APIsMarvin Löbel-1/+1
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-3/+3
2013-11-18Remove the C++ lock_and_signal typeAlex Crichton-7/+5
A the same time this purges all runtime support needed for statically initialized mutexes, moving all users over to the new Mutex type instead.
2013-11-11Move std::rt::io to std::ioAlex Crichton-3/+3
2013-11-11Remove #[fixed_stack_segment] and #[rust_stack]Alex Crichton-56/+4
These two attributes are no longer useful now that Rust has decided to leave segmented stacks behind. It is assumed that the rust task's stack is always large enough to make an FFI call (due to the stack being very large). There's always the case of stack overflow, however, to consider. This does not change the behavior of stack overflow in Rust. This is still normally triggered by the __morestack function and aborts the whole process. C stack overflow will continue to corrupt the stack, however (as it did before this commit as well). The future improvement of a guard page at the end of every rust stack is still unimplemented and is intended to be the mechanism through which we attempt to detect C stack overflow. Closes #8822 Closes #10155
2013-11-10Register new snapshotsAlex Crichton-42/+6
2013-11-09std: os: Document MemoryMapCorey Richardson-3/+49
2013-11-04Move io::file to io::fs and fns out of FileAlex Crichton-19/+10
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-2/+2
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-546/+3
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-24Test fixes and merge conflictsAlex Crichton-1/+3
2013-10-24Remove even more of std::ioAlex Crichton-59/+0
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-24Remove rt::io::supportAlex Crichton-2/+5
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-22Drop the '2' suffix from logging macrosAlex Crichton-34/+34
Who doesn't like a massive renaming?
2013-10-21auto merge of #9936 : madjar/rust/master, r=alexcrichtonbors-6/+0
This should close #9468. I removed the test stating that nested comments should not be implemented. I had a little chicken-and-egg problem because a comment of the std contains "/*", and adding support for nested comment creates a backward incompatibility in that case, so I had to use a dirty hack to get stage1 and stage2 to compile. This part should be revert when this commit lands in a snapshot. This is my first non-typo contribution, so I'm open to any comment.
2013-10-21Add support for nested commentsGeorges Dubus-6/+0
Fixes #9468.
2013-10-20Fix unicode errors on Windows in path_is_dir, path_exists, getcwd and ↵LEE Wondong-1/+86
rust_localtime. This make these functions use wchar_t version of APIs, instead of char version.
2013-10-16path2: Update for latest masterKevin Ballard-2/+2
Also fix some issues that crept into earlier commits during the conflict resoution for the rebase.
2013-10-16path2: Remove some API functionsKevin Ballard-2/+3
Delete the following API functions: - set_dirname() - with_dirname() - set_filestem() - with_filestem() - add_extension() - file_path() Also change pop() to return a boolean instead of an owned copy of the old filename.
2013-10-16path2: Update based on more review feedbackKevin Ballard-5/+5
Standardize the is_sep() functions to be the same in both posix and windows, and re-export from path. Update extra::glob to use this. Remove the usage of either, as it's going away. Move the WindowsPath-specific methods out of WindowsPath and make them top-level functions of path::windows instead. This way you cannot accidentally write code that will fail to compile on non-windows architectures without typing ::windows anywhere. Remove GenericPath::from_c_str() and just impl BytesContainer for CString instead. Remove .join_path() and .push_path() and just implement BytesContainer for Path instead. Remove FilenameDisplay and add a boolean flag to Display instead. Remove .each_parent(). It only had one caller, so just inline its definition there.
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-31/+31
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-137/+137
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-14Remove unused abi attributes.Steve Klabnik-2/+0
They've been replaced by putting the name on the extern block. #[abi = "foo"] goes to extern "foo" { } Closes #9483.
2013-10-11De-pub some private runtime componentsAlex Crichton-1/+1
This change was waiting for privacy to get sorted out, which should be true now that #8215 has landed. Closes #4427
2013-10-09option: rewrite the API to use compositionDaniel Micay-1/+1
2013-10-01Merge fall out of removing fmt!Alex Crichton-4/+4
2013-09-30std: Remove usage of fmt!Alex Crichton-41/+39
2013-09-29reduce heap allocations for MemoryMapJason Toffaletti-7/+7
2013-09-23std: merge rand::{Rng,RngUtil} with default methods.Huon Wilson-2/+2
Also, documentation & general clean-up: - remove `gen_char_from`: better served by `sample` or `choose`. - `gen_bytes` generalised to `gen_vec`. - `gen_int_range`/`gen_uint_range` merged into `gen_integer_range` and made to be properly uniformly distributed. Fixes #8644. Minor adjustments to other functions.
2013-09-18auto merge of #9296 : alexcrichton/rust/snapshots, r=cmrbors-12/+0
huzzah!
2013-09-18Register new snapshotsAlex Crichton-12/+0
2013-09-18fix compilation errors of mips targetJyun-Yan You-1/+1
2013-09-17auto merge of #9235 : olsonjeffery/rust/newrt_file_io_1, r=thestingerbors-10/+1
A quick rundown: - added `file::{readdir, stat, mkdir, rmdir}` - Added access-constrained versions of `FileStream`; `FileReader` and `FileWriter` respectively - big rework in `uv::file` .. most actions are by-val-self methods on `FsRequest`; `FileDescriptor` has gone the way of the dinosaurs - playing nice w/ homing IO (I just copied ecr's work, hehe), etc - added `FileInfo` trait, with an impl for `Path` - wrapper for file-specific actions, with the file path always implied by self's value - has the means to create `FileReader` & `FileWriter` (this isn't exposed in the top-level free function API) - has "safe" wrappers for `stat()` that won't throw in the event of non-existence/error (in this case, I mean `is_file` and `exists`) - actions should fail if done on non-regular-files, as appropriate - added `DirectoryInfo` trait, with an impl for `Path` - pretty much ditto above, but for directories - added `readdir` (!!) to iterate over entries in a dir as a `~[Path]` (this was *brutal* to get working) ...<del>and lots of other stuff</del>not really. Do your worst!
2013-09-17std: fix win32 build issue re: multistring parsingJeff Olson-1/+1
2013-09-17std: fix win32 build error in os::env()Jeff Olson-1/+1