1. 23 3月, 2016 2 次提交
  2. 09 3月, 2016 1 次提交
    • A
      std: Funnel read_to_end through to one location · d46c99ab
      Alex Crichton 提交于
      This pushes the implementation detail of proxying `read_to_end` through to
      `read_to_end_uninitialized` all the way down to the `FileDesc` and `Handle`
      implementations on Unix/Windows. This way intermediate layers will also be able
      to take advantage of this optimized implementation.
      
      This commit also adds the optimized implementation for `ChildStdout` and
      `ChildStderr`.
      d46c99ab
  3. 15 2月, 2016 1 次提交
    • P
      Refactor windows::fs::FileAttr · 44e31b91
      Paul Dicker 提交于
      Because we no longer use `GetFileAttributesExW` FileAttr is never created
      directly from `WIN32_FILE_ATTRIBUTE_DATA` anymore.
      So we should no longer store FileAttr's attributes in that c struct.
      44e31b91
  4. 14 2月, 2016 1 次提交
    • P
      Fixes #28528 · 6403f913
      Paul Dicker 提交于
      Fix `read_link` to also be able to read the target of junctions on Windows.
      Also the path returned should not include a NT namespace, and there were
      some problems with permissions.
      6403f913
  5. 08 2月, 2016 1 次提交
  6. 05 2月, 2016 1 次提交
    • A
      std: Expose SystemTime accessors on fs::Metadata · d1681bbd
      Alex Crichton 提交于
      These accessors are used to get at the last modification, last access, and
      creation time of the underlying file. Currently not all platforms provide the
      creation time, so that currently returns `Option`.
      d1681bbd
  7. 04 2月, 2016 3 次提交
  8. 02 2月, 2016 1 次提交
  9. 27 1月, 2016 1 次提交
  10. 20 1月, 2016 1 次提交
  11. 16 1月, 2016 1 次提交
  12. 14 1月, 2016 1 次提交
    • P
      Implement RFC 1252 expanding the OpenOptions structure · 42f4dd04
      Paul Dicker 提交于
      Tracking issue: #30014
      
      This implements the RFC and makes a few other changes.
      I have added a few extra tests, and made the Windows and
      Unix code as similar as possible.
      
      Part of the RFC mentions the unstable OpenOptionsExt trait
      on Windows (see #27720). I have added a few extra methods
      to future-proof it for CreateFile2.
      42f4dd04
  13. 21 11月, 2015 1 次提交
  14. 20 11月, 2015 1 次提交
  15. 10 11月, 2015 1 次提交
    • A
      std: Migrate to the new libc · 3d28b8b9
      Alex Crichton 提交于
      * Delete `sys::unix::{c, sync}` as these are now all folded into libc itself
      * Update all references to use `libc` as a result.
      * Update all references to the new flat namespace.
      * Moves all windows bindings into sys::c
      3d28b8b9
  16. 13 10月, 2015 1 次提交
    • B
      Make the Metadata struct Clone · b40163be
      Ben S 提交于
      This commit adds #[derive(Clone)] to std::fs::Metadata, making that struct
      cloneable. Although the exact contents of that struct differ between OSes,
      they all have it contain only value types, meaning that the data can be re-used without repercussions.
      
      It also adds #[derive(Clone)] to every type used by that struct across all
      OSes, including the various Unix `stat` structs and Windows's
      `WIN32_FILE_ATTRIBUTE_DATA`.
      b40163be
  17. 30 9月, 2015 1 次提交
  18. 03 9月, 2015 1 次提交
  19. 13 8月, 2015 1 次提交
    • A
      Remove all unstable deprecated functionality · 8d90d3f3
      Alex Crichton 提交于
      This commit removes all unstable and deprecated functions in the standard
      library. A release was recently cut (1.3) which makes this a good time for some
      spring cleaning of the deprecated functions.
      8d90d3f3
  20. 12 8月, 2015 1 次提交
    • A
      Register new snapshots · 938099a7
      Alex Crichton 提交于
      * Lots of core prelude imports removed
      * Makefile support for MSVC env vars and Rust crates removed
      * Makefile support for morestack removed
      938099a7
  21. 04 8月, 2015 1 次提交
    • A
      syntax: Implement #![no_core] · 5cccf3cd
      Alex Crichton 提交于
      This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of
      the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The
      `#![no_std]` attribute now injects `extern crate core` at the top of the crate
      as well as the libcore prelude into all modules (in the same manner as the
      standard library's prelude). The `#![no_core]` attribute disables both std and
      core injection.
      
      [rfc]: https://github.com/rust-lang/rfcs/pull/1184
      5cccf3cd
  22. 21 7月, 2015 2 次提交
  23. 10 7月, 2015 2 次提交
  24. 28 6月, 2015 1 次提交
    • A
      std: Fix Windows XP compatibility · 10b103af
      Alex Crichton 提交于
      This commit enables executables linked against the standard library to run on
      Windows XP. There are two main components of this commit:
      
      * APIs not available on XP are shimmed to have a fallback implementation and use
        runtime detection to determine if they are available.
      * Mutexes on Windows were reimplemented to use critical sections on XP where
        rwlocks are not available.
      
      The APIs which are not available on XP are:
      
      * SetFileInformationByHandle - this is just used by `File::truncate` and that
        function just returns an error now.
      * SetThreadStackGuarantee - this is used by the stack overflow support on
        windows, but if this isn't available then it's just ignored (it seems
        non-critical).
      * All condition variable APIs are missing - the shims added for these apis
        simply always panic for now. We may eventually provide a fallback
        implementation, but for now the standard library does not rely on condition
        variables for normal use.
      * RWLocks, like condition variables, are missing entirely. The same story for
        condition variables is taken here. These APIs are all now panicking stubs as
        the standard library doesn't rely on RWLocks for normal use.
      
      Currently, as an optimization, we use SRWLOCKs for the standard `sync::Mutex`
      implementation on Windows, which is indeed required for normal operation of the
      standard library. To allow the standard library to run on XP, this commit
      reimplements mutexes on Windows to use SRWLOCK instances *if available* and
      otherwise a CriticalSection is used (with some checking for recursive
      locking).
      
      With all these changes put together, a 32-bit MSVC-built executable can run on
      Windows XP and print "hello world"
      
      Closes #12842
      Closes #19992
      Closes #24776
      10b103af
  25. 11 6月, 2015 1 次提交
  26. 09 6月, 2015 1 次提交
  27. 08 5月, 2015 1 次提交
  28. 29 4月, 2015 2 次提交
    • A
      std: Fix inheriting standard handles on windows · c1149edf
      Alex Crichton 提交于
      Currently if a standard I/O handle is set to inherited on Windows, no action is
      taken and the slot in the process information description is set to
      `INVALID_HANDLE_VALUE`. Due to our passing of `STARTF_USESTDHANDLES`, however,
      this means that the handle is actually set to nothing and if a child tries to
      print it will generate an error.
      
      This commit fixes this behavior by explicitly creating stdio handles to be
      placed in these slots by duplicating the current process's I/O handles. This is
      presumably what previously happened silently by using a file-descriptor-based
      implementation instead of a `HANDLE`-centric implementation.
      
      Along the way this cleans up a lot of code in `Process::spawn` for Windows by
      ensuring destructors are always run, using more RAII, and limiting the scope of
      `unsafe` wherever possible.
      c1149edf
    • A
      std: Implement fs::DirBuilder · 0368abb0
      Alex Crichton 提交于
      This is the last remaining portion of #24796
      0368abb0
  29. 28 4月, 2015 1 次提交
    • A
      std: Expand the area of std::fs · 93487000
      Alex Crichton 提交于
      This commit is an implementation of [RFC 1044][rfc] which adds additional
      surface area to the `std::fs` module. All new APIs are `#[unstable]` behind
      assorted feature names for each one.
      
      [rfc]: https://github.com/rust-lang/rfcs/pull/1044
      
      The new APIs added are:
      
      * `fs::canonicalize` - bindings to `realpath` on unix and
        `GetFinalPathNameByHandle` on windows.
      * `fs::symlink_metadata` - similar to `lstat` on unix
      * `fs::FileType` and accessor methods as `is_{file,dir,symlink}`
      * `fs::Metadata::file_type` - accessor for the raw file type
      * `fs::DirEntry::metadata` - acquisition of metadata which is free on Windows
        but requires a syscall on unix.
      * `fs::DirEntry::file_type` - access the file type which may not require a
        syscall on most platforms.
      * `fs::DirEntry::file_name` - access just the file name without leading
        components.
      * `fs::PathExt::symlink_metadata` - convenience method for the top-level
        function.
      * `fs::PathExt::canonicalize` - convenience method for the top-level
        function.
      * `fs::PathExt::read_link` - convenience method for the top-level
        function.
      * `fs::PathExt::read_dir` - convenience method for the top-level
        function.
      * `std::os::raw` - type definitions for raw OS/C types available on all
        platforms.
      * `std::os::$platform` - new modules have been added for all currently supported
        platforms (e.g. those more specific than just `unix`).
      * `std::os::$platform::raw` - platform-specific type definitions. These modules
        are populated with the bare essentials necessary for lowing I/O types into
        their raw representations, and currently largely consist of the `stat`
        definition for unix platforms.
      
      This commit also deprecates `Metadata::{modified, accessed}` in favor of
      inspecting the raw representations via the lowering methods of `Metadata`.
      93487000
  30. 22 4月, 2015 3 次提交
    • A
      Test fixes and rebase conflicts, round 1 · 224fc108
      Alex Crichton 提交于
      224fc108
    • A
      std: Bring back f32::from_str_radix as an unstable API · a568a7f9
      Alex Crichton 提交于
      This API was exercised in a few tests and mirrors the `from_str_radix`
      functionality of the integer types.
      a568a7f9
    • B
      Deprecate std::fs::soft_link in favor of platform-specific versions · 3cc84efc
      Brian Campbell 提交于
      On Windows, when you create a symbolic link you must specify whether it
      points to a directory or a file, even if it is created dangling, while
      on Unix, the same symbolic link could point to a directory, a file, or
      nothing at all.  Furthermore, on Windows special privilege is necessary
      to use a symbolic link, while on Unix, you can generally create a
      symbolic link in any directory you have write privileges to.
      
      This means that it is unlikely to be able to use symbolic links purely
      portably; anyone who uses them will need to think about the cross
      platform implications.  This means that using platform-specific APIs
      will make it easier to see where code will need to differ between the
      platforms, rather than trying to provide some kind of compatibility
      wrapper.
      
      Furthermore, `soft_link` has no precedence in any other API, so to avoid
      confusion, move back to the more standard `symlink` terminology.
      
      Create a `std::os::unix::symlink` for the Unix version that is
      destination type agnostic, as well as `std::os::windows::{symlink_file,
      symlink_dir}` for Windows.
      
      Because this is a stable API, leave a compatibility wrapper in
      `std::fs::soft_link`, which calls `symlink` on Unix and `symlink_file`
      on Windows, preserving the existing behavior of `soft_link`.
      3cc84efc
  31. 21 4月, 2015 1 次提交
    • C
      Implement Debug for File · 1131bc0a
      Chris Wong 提交于
      This patch adds a `Debug` impl for `std::fs::File`.
      
      On all platforms (Unix and Windows) it shows the file descriptor.
      
      On Linux, it displays the path and access mode as well.
      
      Ideally we should show the path/mode for all platforms, not just Linux,
      but this will do for now.
      
      cc #24570
      1131bc0a
  32. 09 4月, 2015 1 次提交
    • A
      std: Fix fs::read_link behavior on Windows · f3f99fb4
      Alex Crichton 提交于
      The current implementation of using GetFinalPathNameByHandle actually reads all
      intermediate links instead of just looking at the current link. This commit
      alters the behavior of the function to use a different API which correctly reads
      only one level of the soft link.
      
      [breaking-change]
      f3f99fb4