Commit Graph
93 Commits
Author SHA1 Message Date
Eric St. John 92e7800c1c Fix build break in System.IO.FileSystem.WinRT caused by https://github.com/dotnet/corefx/pull/1179
Corefx builds don't actuall build N libraries so this was latent in the open source repo for about a week.  This just cleans up a few missed items from the refactoring done in pr dotnet/corefx#1179.

[tfs-changeset: 1442019]


Commit migrated from https://github.com/dotnet/corefx/commit/d39bc9b2a92f17e1d2966e73e8ad27df25b943ce
2015-03-30 09:36:37 -07:00
Matt Cohn d737e65473 Update System.IO.FileSystem test csproj and packages.config
Update System.IO.FileSystem.Tests.csproj with new and ported
test assets, and packages.config for additional contracts those
new tests require.


Commit migrated from https://github.com/dotnet/corefx/commit/c43e249b11cb1451bc125c85dffd10fefe3f655f
2015-03-27 14:32:10 -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
Matt Cohn 89cfd52cfb Add some new DirectoryInfo tests
Add new DirectoryInfo tests for Create, CreateSubdirectory(str),
Delete, Delete(bool), .ctor(string), Exists.  Based on ToF tests but
rewritten.


Commit migrated from https://github.com/dotnet/corefx/commit/397142e8523bc6af4ba7711de91b678d6d7d84f7
2015-03-27 14:31:01 -07:00
Stephen Toub 34ee1cb151 Merge pull request dotnet/corefx#1213 from stephentoub/fix_filestream_unix
Fix FileStream src/tests on Linux

Commit migrated from https://github.com/dotnet/corefx/commit/4285afc7a857d01b889c8449be683af2f2508266
2015-03-25 16:51:03 -07:00
Stephen Toub 45cc9c2b45 Merge pull request dotnet/corefx#1228 from stephentoub/fix_fsw_tests
Fix FileSystemWatcher src/tests on Linux

Commit migrated from https://github.com/dotnet/corefx/commit/e356e98d1ad32113bc47506baf5a1e19ea942363
2015-03-24 22:50:33 -07:00
chcosta 7de8908cf6 Merge pull request dotnet/corefx#1200 from dotnet-bot/from-tfs
Merge changes from TFS

Commit migrated from https://github.com/dotnet/corefx/commit/b47471f7db895d9e1b48634187b7055696b6ddf2
2015-03-23 22:20:04 -07:00
Stephen Toub 6b9fef7a91 Fix FileSystemWatcher src/tests on Linux
This commit fixes issues highlighted when running the System.IO.FileSystem.Watcher tests on Linux.  There are 49 tests that pass on Windows; after these product and test fixes, only 7 of those fail on Linux, all due to Windows-specific tests that will need to be tweaked based on target system or disabled entirely on Linux:
- 2 are P/Invoking to Win32 functions related to security
- 3 are trying to overflow the event buffer but not doing so on Linux
- 2 are expecting case-insensitive file paths


Commit migrated from https://github.com/dotnet/corefx/commit/7176a0dc531a1a9c9032c36330bbf92e7ca57f65
2015-03-23 17:54:49 -07:00
Matt Ellis 8ecdc37b0d Use CoreCLR's GetFileInformation instead of stat
In dotnet/coreclr c323646b, I introduced a new API on the PAL called
GetFileInformation which wraps fstat/stat since these functions differ
between OS's and architecture.

This change removes our uses of stat in favor of this API, which
provides a stable ABI across platforms.

Fixes dotnet/corefx#371


Commit migrated from https://github.com/dotnet/corefx/commit/9115af1b4f458b7dc41a040c45266898f8d84512
2015-03-23 16:00:13 -07:00
Stephen Toub b7aafbcdf5 Fix FileStream tests on Linux
There are 338 System.IO.FileSystem tests currently passing on Windows.  On Linux, 65 of these are currently failing, mostly negative tests expecting a certain exception and getting a different actual one or none at all.

This commit fixes 40 of those, mostly via product fixes, plus a few test tweaks (where the test was based on something specific to Windows), such that now only 25 are failing.  Of those 25, 24 are tests for FileSharing that are expecting exceptions not being generated on Linux because that support isn't available in the library; we'll most likely just disable these tests for Linux.  The remaining 1 test fails because it's expecting ReadAsync to complete synchronously if the read can be satisfied from the read buffer, and the current ReadAsync/WriteAsync implementations just delegate to the base class for functionality; we already have a work item open to eventually address that.


Commit migrated from https://github.com/dotnet/corefx/commit/8062cc0dbed1ad31b9e6d438ddc71d91ee066031
2015-03-23 02:41:20 -04:00
Pallavi Taneja a23e007de5 Consolidate interop calls for the following assemblies.
1. System.IO.FileSystem
2. System.IO.FileSystem.DriveInfo
3. System.IO.MemoryMappedFiles
4. System.IO.Pipes

Cleanup of shared interop code
1. Remove security annotations
2. Change public to internal
3. Remove unwanted namespaces


Commit migrated from https://github.com/dotnet/corefx/commit/92ebda3212c05c1f8b972c84be5012d581938311
2015-03-20 18:04:55 -07:00
Christopher Costa 7e2dd3ad7b Delete closed libraries sources and reference open sources.
This change removes the closed libraries sources for libraries which we are now building in the open.  Stub project files are left in the closed libraries which improt sources from the open for various build configurations.

Also includes these two changes which were not yet ported to open:
- [Serialization]: DCS/DCJS fails to serialize/deserialize XElement type - regression
- Change namespace of System.Xml.XPath.XmlDocument extensions

Validated by pre-checkin gauntlet build dotnet/corefx#150320.14337

[tfs-changeset: 1437136]


Commit migrated from https://github.com/dotnet/corefx/commit/89881048ba6bb6adca5253024ea59e8aa8790a6a
2015-03-20 17:07:34 -07:00
Matt Ellis 53a9f1fe9a Refactor build properties for Linux and OSX builds
Previously, we used the catch all OS=Unix property in MSBuild to
determine if we were building for Windows vs Unix, and we shared the
same MSIL between Linux and OSX.  However, we have already started to
take dependencies on Linux specific APIs and we plan on using OSX
specific APIs very soon.

We don't want to try to ship MSIL that contains both Linux and OSX
specific implementations of a feature, so the build system needs to
change a little.

We'll continue to use the OS property as the entry point for the build
to specificy what platform you want to build for.  However, we now have
three platforms:

1. Windows_NT
2. Linux
3. OSX

However, the value of the OS property should not be tested directly,
instead we introduce properties about the target platform itself:

1. TargetsWindows
2. TargetsUnix
3. TargetsLinux
4. TargetsOSX

Code which works the same across Linux and OSX should be guarded by
TargetsUnix (which is true when OS is either 'Linux' or 'OSX').  Code
specific to one OS can be guarded with either TargetsLinux or
TargetsUnix.

In this change, I have simply rewritten all the '$(OS)' == 'Unix'
conditions to '$(TargetsUnix)' == 'true'.  A few libraries may do Linux
specific stuff, but we will clean up that debt when we go to flesh out
the OSX implementations.


Commit migrated from https://github.com/dotnet/corefx/commit/4d07173fbf86631d49ed56623581eff9cb7d3f87
2015-03-19 14:07:07 -07:00
Stephen Toub 806eeb620e Fix null deref in UnixFileStream ctor
UnixFileStream's ctor that accepts a SafefileHandle was calling
_parent.CanSeek, but no calls to _parent should be made in the ctor
of a FileStreamBase because the _parent FileStream's _innerStream
hasn't yet been assigned to this FileStreamBase instance being
constructed.


Commit migrated from https://github.com/dotnet/corefx/commit/fd63109117869fc732e53247d3b77ff754efd19d
2015-03-18 19:22:25 -04:00
Tarek Mahmoud Sayed b3120f73dd Remove checked in resources generated code file (SR.cs)
After this change it is no longer required to include the resources
generated code file SR.cs inside the project tree as such files
will get automatically generated in the intermediate folder


Commit migrated from https://github.com/dotnet/corefx/commit/e7513c213c16f5ca4bd35c6c4eace534b4d94ed5
2015-03-17 16:24:08 -07:00
Pallavi Taneja 6de41a0f16 Consolidate Interop calls for Microsoft.Win32.Primitives and System.Console
Commit migrated from https://github.com/dotnet/corefx/commit/4048ca85577f53539d6e4c511836f326643a0024
2015-03-13 10:18:59 -07:00
Christopher Costa dfb68f88ad Port CS dotnet/corefx#1384848 from ProjectN
1384848	Eric St. John	12/11/2014 13:31	Recent FI broke my hack for FileOptions.Encrypted.  I'm undoing the workaround for this.  Recent discussions have been t...

[tfs-changeset: 1426493]


Commit migrated from https://github.com/dotnet/corefx/commit/34ad0bb3a783401caa469824cb7adb140242c675
2015-03-05 15:58:44 -08:00
Stephen Toub 3758e27cc0 Implement System.IO.Pipes on Unix
Commit migrated from https://github.com/dotnet/corefx/commit/c473c8d50d997c66722fdf9bee50f91b707c903c
2015-03-04 22:59:48 -05:00
Tarek Mahmoud Sayed d52779a137 Cleanup project files from empty items with resource comments
Commit migrated from https://github.com/dotnet/corefx/commit/47b1663630ab0a6089d1a95c8d9934af3c6bc92b
2015-03-04 11:34:17 -08:00
Tarek Mahmoud Sayed 12598db216 Cleanup resources across all projects
After this change we are going to have unified model for handling resources which is we always use resx files placed under Resources folder and the code will be automatically generated in SR.cs file.
We’ll access ant string resource using the SR class (e.g. SR.ArgumentException).


Commit migrated from https://github.com/dotnet/corefx/commit/db7180f04ef9789a7f199fcd9f8c527990e14673
2015-03-04 11:34:16 -08:00
Nick Guerrera f022d5bba7 Bump package versions to latest
Commit migrated from https://github.com/dotnet/corefx/commit/a4d211e9a250c5975022f32d3d7b036e2ba12488
2015-03-04 11:02:12 -08:00
Eric StJohn 55dff7e34e Clarify behavior of ShouldUseWinRT and eliminate redundant calls to GetLastError.
Commit migrated from https://github.com/dotnet/corefx/commit/d88fbe95b3a202e48ba43e050f908091aca3730f
2015-03-03 14:29:37 -08:00
Eric StJohn 2cb7047d92 Don't recurse when Selecting a FileSystem implementation for opening a file
In MultiplexingWin32WinRTFileSystem we were treating all Opens as potentially
creating a file.  As a result we would walk up the path until we found some
existing folder (or failure) so that we could give the FileSystem implementation
a chance to fill in the entire missing path on a create.  This was incorrect
for Open operations (FileMode.Open and FileMode.Truncate) and resulted
in poorer performance for Open as well as incorrect exceptions.


Commit migrated from https://github.com/dotnet/corefx/commit/ee3e4566814cf96c0f517d340f221a9472a4df2d
2015-03-03 12:37:16 -08:00
Eric StJohn 186128a7fd Fix UseWinRT heuristic to better handle app container roots
We were using FindFirstFileEx to get file attributes in order to determine if
the file/directory is accessible by Win32.  This is failing for root folders in
ApplicationData locations, even though they are accessible by Win32.  The
reason seems to be that FindFirstFileEx on a full path requires that the parent
have permission to enumerate contents, even though we've passed a full
path and have full access to that path (likely a bug in FindFirstFileEx).
Using GetFileAttributesEx is better in most cases since it is faster and does
not require permission to enumerate contents.  I've switched to using
GetFileAttributesEx first and only falling back to FindFirstFile when we might
have a reparse point that could be a placeholder file.


Commit migrated from https://github.com/dotnet/corefx/commit/cd0216d3350ed210f9bdbf6c083ce020655a105d
2015-03-03 12:37:12 -08:00
Stephen Toub fa740f8c72 Separate gnu_get_libc_version into its own file
Commit migrated from https://github.com/dotnet/corefx/commit/3389cbaa146f525f0aa5517b7b4fceeece776bfa
2015-03-01 13:21:29 -05:00
Pallavi Taneja 7f18e72a0c Update resource generation for libraries.
[tfs-changeset: 1422400]


Commit migrated from https://github.com/dotnet/corefx/commit/3ad583086b7b5eebfaca535fea861b871776cc3d
2015-02-26 17:55:48 -08:00
Matt Ellis 2af142d417 Merge pull request dotnet/corefx#917 from Maxwe11/share_handle
Using shared CloseHandle interop

Commit migrated from https://github.com/dotnet/corefx/commit/e050c1c192147bf37a54e4a36578886f957a334e
2015-02-21 13:53:54 -08:00
Maxwe11 6a98eb9ef5 Move *.sln files to the appropriate projects folders
Commit migrated from https://github.com/dotnet/corefx/commit/fb8fb441b3e5414590b8d1af4ec5f52ca52c0dff
2015-02-20 19:52:00 +02:00
Maxwe11 42c28878f7 Split up System.IO.FileSystem solution
Commit migrated from https://github.com/dotnet/corefx/commit/ac61aba0b1c30a27e3d5594d646088a617bc9a91
2015-02-20 03:05:00 +02:00
Maxwe11 0b7f899922 Fix projects to rely on shared CloseHandle interop
Some projects was using its own definition of CloseHandle interop.
This commit changes it to use the shared definition from Common folder.


Commit migrated from https://github.com/dotnet/corefx/commit/7a15b10c05385d399bb664e78e91db03bd6b4a90
2015-02-19 19:27:37 +02:00
Maxwe11 24de629e0f Using shared FormatMessage interop
Commit migrated from https://github.com/dotnet/corefx/commit/ab7f5a2189f990d1ec4c36de5baf31133c86a6cf
2015-02-19 09:18:47 +02:00
Stephen Toub 0188aeb399 Merge pull request dotnet/corefx#818 from stephentoub/os_proj_config
Update solutions/projects with OS-specific configs

Commit migrated from https://github.com/dotnet/corefx/commit/7dc38bf6e203210f987d41a579de1f44c81550e1
2015-02-18 19:39:20 -05:00
Matt Johnson 8d91f6af80 Fix typos in private/internal field names
Commit migrated from https://github.com/dotnet/corefx/commit/ca2ab51da39267d2abc4b2cc72b7b8b0abf72090
2015-02-18 14:38:05 -08:00
Matt Johnson 9111c18563 Fix typos in local variable names
Commit migrated from https://github.com/dotnet/corefx/commit/917f4d4516e6b99e54c70b1c90849f81c8bb70df
2015-02-18 14:37:50 -08:00
Matt Johnson ccd5e9e34a Fix typos in comments
Commit migrated from https://github.com/dotnet/corefx/commit/4a3d2d5b7b53a6d37fcc54553f5d0f62b2d6cff7
2015-02-18 14:37:35 -08:00
Stephen Toub 9d37aa1eeb Move Windows-specific path validation out of shared FileStream
FileStream currently has a few path validation checks that are specific to Windows. This commit moves these checks into a Windows-specific file.


Commit migrated from https://github.com/dotnet/corefx/commit/76e9792630370db053e67254a7b658528a3affdd
2015-02-18 15:01:03 -05:00
Stephen Toub 2c54a7ae72 Update solutions/projects with OS-specific configs
For projects that have OS-specific implementations, this change modifies
their solution and project files to create OS-specific configurations.
Rather than just having a Debug or Release option, in Visual Studio a
developer can now select OS_Debug or OS_Release, e.g. for a project that
has a Windows implementation and a Unix implementation, Windows_Debug,
Windows_Release, Unix_Debug, and Unix_Release will all be available
options.  Changing the configuration will update the properties used to
configure conditional includes, build outputs, etc.


Commit migrated from https://github.com/dotnet/corefx/commit/d3b259b89877e4a52d12c08e0f9031f37cb0905b
2015-02-18 13:01:48 -05:00
Stephen Toub 0e4843b792 Merge pull request dotnet/corefx#800 from stephentoub/fix_cc
Enable code coverage on VS2015 and include more libraries

Commit migrated from https://github.com/dotnet/corefx/commit/f5b26d5afc6abcac978e7c5642bef7dc23e5ee18
2015-02-18 07:20:21 -05:00
Eric StJohn 9106fd0c33 Fix build break for WinRTFileSystem
We aren't building the WinRT filesystem implementation in the open and
I broke it with a previous change to call through derived members of FileStream.


Commit migrated from https://github.com/dotnet/corefx/commit/9d3b4e45ef359ffda861b7d85e158c572a4454e7
2015-02-17 17:09:17 -08:00
Stephen Toub 150a2f4e75 Re-enable code coverage for (most) disabled libraries
Several libraries had their code coverage disabled due to unknown problems.  The change to a more recent version of OpenCover appears to have addressed whatever those issues were, as the problems no longer repro.  This commit just re-enables the code coverage for those libraries.

The only remaining library with its code coverage disabled is System.Diagnostics.Process.dll.  It's either hanging or just taking a really long time to complete.  Investigation still needed.


Commit migrated from https://github.com/dotnet/corefx/commit/01c18f27d5a6c383701e0407b55e6edfae203309
2015-02-17 16:44:44 -05:00
Stephen Toub 8cc26c6cc2 Scrubs [ComVisible] attribution from CoreFX library sources
Commit migrated from https://github.com/dotnet/corefx/commit/9189f0a7f60f217a8cfec2d4bdafaf7132d6d067
2015-02-16 13:20:46 -05:00
chcosta d1620100c8 Sync changes from TFS as of 2015/02/16 9:30:00 AM
[tfs-changeset: 1416076]


Commit migrated from https://github.com/dotnet/corefx/commit/67bd740c6c732e141835521ff34b2cc18591a9cc
2015-02-16 09:51:49 -08:00
Stephen Toub eaeb6391bb Merge pull request dotnet/corefx#654 from stephentoub/process_unix
Implement System.Diagnostics.Process on Linux

Commit migrated from https://github.com/dotnet/corefx/commit/88f0dac59872dcd2ee7f482c5ec6b245e80d5704
2015-02-13 15:21:26 -05:00
Stephen Toub 49be027424 Add support for path resolution in Process.Start
We were previously just using the exact path provided as the ProcessStartInfo.Filename.  With this commit, we now use the same basic path resolution logic as is used on Windows (except for Windows-specific aspects): the specified path if it's absolute, then the executable's directory, then the current directory, and then each of the directories in the PATH environment variable.


Commit migrated from https://github.com/dotnet/corefx/commit/091b73b54451f777f751cf44460211639043e9b9
2015-02-12 15:45:39 -05:00
Stephen Toub 214d0f8c29 Merge pull request dotnet/corefx#742 from ellismg/contract-to-debug-assert
Convert Contract.Assert to Debug.Assert.

Commit migrated from https://github.com/dotnet/corefx/commit/cb9daab7806cd906a1a0abb856e371016f2040e8
2015-02-11 18:19:34 -05:00
Matt Ellis 91409b75fa Replace Contract.Assert with Debug.Assert
Fixes dotnet/corefx#682


Commit migrated from https://github.com/dotnet/corefx/commit/980e41dc6beef8caf4a4369fea2028e1c7cbaf38
2015-02-11 11:55:51 -08:00
Stephen Toub 304df98274 Use lseek instead of lseek64 in Unix I/O
As part of this, changed interop definitions of off_t to be Int64 rather than IntPtr.  For now we're assuming that we'll run either on 64-bit systems and/or where _FILE_OFFSET_BITS == 64.  We can revisit this if that assumption fails.


Commit migrated from https://github.com/dotnet/corefx/commit/198d30af095675a8eaaa387d14c68621065fecbd
2015-02-11 10:04:30 -05:00
Stephen Toub 02d3286c76 Replace open64 usage with open in Unix libs
Use the POSIX-compliant open function instead of open64.


Commit migrated from https://github.com/dotnet/corefx/commit/e2ad5a8a55b7167286dfa3e45af6c97e59485abd
2015-02-10 01:05:33 -05:00
Maxwe11 2d635dae1c Replace relative path to common tests with a variable
Replace relative path "..\..\Common\tests" with $(CommonTestPath) variable.


Commit migrated from https://github.com/dotnet/corefx/commit/56dbc6abc6dcde5874c99c67f379d788c8dd4420
2015-02-08 15:05:37 +02:00
Nick Guerrera 96ee8ecc84 Merge pull request dotnet/corefx#688 from dotnet/v1.0
Merge v1.0 -> master

Commit migrated from https://github.com/dotnet/corefx/commit/bd08ac4fe67dd91dac06681a536683f1baf1dada
2015-02-07 15:05:35 -08:00