Commit Graph
5 Commits
Author SHA1 Message Date
Stephen Toub cdf97700fa Fix System.IO.FileSystem product source and tests for Linux
Prior to this set of changes, 110 of the FileSystem tests were failing on Linux.  After this change, all allowed tests pass.

Primary product fixes:
- Using rmdir/unlink for directory/file deletion rather than using remove
- Disallowing FileStreams to be opened for directories
- Supporting copying files when only target directory (not target name) is specified
- Overhauling directory enumeration to ensure to match Win32 behaviors related to search pattern normalization, input validation, supporting re-iteration through an enumerable, outputting partial paths based on user-supplied path, using a SafeHandle to ensure resources are cleaned up
- Fixing FileSystemObject.LastWriteTime to correctly return the LastWriteTime rather than LastAccessTime
- Fixing FileAttributes.ReadOnly handling due to inappropriate caching
- Validating inputs to FileSystemObject.Attributes, and make sure that changes to attributes are visible afterwards
- Adding support for getting CreationTime if it's supported by the OS
- Marking links with FileAttributes.ReparsePoint
- Working around current runtime bug related to exception handling and finally blocks getting executed twice

Primary test fixes:
- Suppressing tests as platform-specific that dependend on Win32-isms like drive letters, alternate data streams, etc.
- Changing a bunch of '\' usage to instead use Path.DirectorySeparatorChar or Path.Combine
- Adapting to behavioral differences between Windows and Unix, e.g. whether a directory can be deleted if it's readonly, invalid path characters, max path lengths, file sharing differences, etc.

These changes should all accrue to OSX as well, but we'll need to separately do an exercise to clean this library and tests up there for anything OSX-specific.


Commit migrated from https://github.com/dotnet/corefx/commit/dd48c9dc1f0a7142a005ff1d4c162e10facda306
2015-04-10 13:13:34 -04:00
Stephen Toub 525d3c65b0 Merge pull request dotnet/corefx#1302 from stephentoub/fix_filesystem_tests
Lots of FileSystem test fixes for Unix

Commit migrated from https://github.com/dotnet/corefx/commit/2cc25c72acf7b4aef038e8534c69251694a5eced
2015-04-02 09:23:44 -04:00
Stephen Toub 54fb8cec30 Lots of FileSystem test fixes for Unix
The FileSystem tests are a mess... including on Windows, but especially on Unix.  Before the File/Directory/etc. tests got checked in, the FileSystem tests (which then were really only for FileStream and were fairly clean) could run on Unix, with 25 of the 360 tests failing due primarily to lack of support for FileShare options.  Now, with ~575 tests, when run on Unix more than 300 fail, runtime assertions occur in multiple places, and worst, all of the files in your working directory end up getting deleted!

This commit has a first set of fixes, primarily involving ensuring that paths are specified appropriately, with hundreds of changes to ensure that the right path separator is used, that particular roots aren't assumed, etc.  After this commit, on Unix we're down from > 300 failures to 114 failures, and the suite is able to finish running without deleting the working directory.


Commit migrated from https://github.com/dotnet/corefx/commit/d9465170db0be15a6e8d8ca6ba591a358f709ec5
2015-03-31 16:32:43 -04:00
Stephen Toub abbd32deba Remove Console.WriteLines from FileSystem tests
A few Console.WriteLine calls in the FileSystem tests are resulting in tons of unnecessary output while running tests.  Removing them.


Commit migrated from https://github.com/dotnet/corefx/commit/e71d652811b95950a71a0bd0fdd6b6206f50ae01
2015-03-31 10:57:15 -07:00
dotnet-bot 58d9a445c5 Add ported System.IO.FileSystem tests
Add ported System.IO.FileSystem tests for Directory, DirectoryInfo,
File, FileInfo.


Commit migrated from https://github.com/dotnet/corefx/commit/25841a3761cab292153bd0a917a4ce192be8ffab
2015-03-27 14:31:02 -07:00