Commit Graph
50 Commits
Author SHA1 Message Date
Rodrigo Kumpera b96d05dac3 Kill the MOONLIGHT define in corlib. 2013-02-11 16:03:28 -05:00
Marek Safar 7883a2dafd Clean up some static initializers 2012-10-03 12:19:55 +01:00
Miguel de Icaza 2852ed0b59 Update copyrights 2011-09-13 18:26:13 -04:00
Sebastien Pouliot 8d641b33e7 Throwing IsolatedStorageException is a Moonlight-behavior and should not have been exposed to other 2.1 profiles 2011-09-09 13:18:37 -04:00
Alan McGovern 2c78755226 [System.IO.Path] Fix potential infinite loop in Path.GetTempFileName
Refactor this method so that it only attempts alternative filenames if
the filename just attempted already exists. This way we will never end
up looping forever being unable to create the required file. Previously
if we opened the maximum allowed files and then called GetTempFileName
we'd loop forever throwing an IOException in the FileStream constructor
every time.
2011-08-02 17:54:39 +01:00
Miguel de Icaza 4ca87b5d71 2009-11-23 Miguel de Icaza <[email protected]>
* Directory.cs: Add EnumerateFiles and EnumerateFileSystemEntries
	overloads.    Share code.

svn path=/trunk/mcs/; revision=146706
2009-11-23 06:51:41 +00:00
Miguel de Icaza 957a0f21d3 2009-11-22 Miguel de Icaza <[email protected]>
* Directory.cs: Added new IEnumerable methods to Directory.

	* MonoIO.cs: Surface a high level FindFirst/FindNext API to
	implement the various enumerable APIs.

svn path=/trunk/mcs/; revision=146698
2009-11-23 03:44:51 +00:00
Miguel de Icaza 0204abe803 Drop more obsolete defines
svn path=/trunk/mcs/; revision=144304
2009-10-17 01:35:27 +00:00
Sebastien Pouliot ada00d32ed 2009-09-23 Sebastien Pouliot <[email protected]>
* Directory.cs: Don't expose SearchOption in NET_2_1
	* DirectoryInfo.cs: Don't expose SearchOption in NET_2_1
	* MonoIO.cs: Don't throw a DriveNotFoundException under NET_2_1 -
	an IOExpection will be thrown (like the 1.x profile)


svn path=/trunk/mcs/; revision=142479
2009-09-23 12:41:59 +00:00
Gonzalo Paniagua Javier e74faa5cd0 2009-02-12 Gonzalo Paniagua Javier <[email protected]>
* MonoIO.cs:
	* MonoIOError.cs: enable ERROR_NOT_SAME_DEVICE.


svn path=/trunk/mcs/; revision=126688
2009-02-12 07:43:30 +00:00
Jonathan Chambers 84ec87d71b 2008-11-06 Jonathan Chambers <[email protected]>
* MonoIO.cs : Add DuplicateHandle.

2008-11-06  Jonathan Chambers  <[email protected]>

        * Process.cs : Use DuplicateHandle when redirecting
        StdInput and StdOutput. Fixes bug #436291.



svn path=/trunk/mcs/; revision=118134
2008-11-06 18:48:08 +00:00
Sebastien Pouliot 1a5608d94e 2008-08-22 Sebastien Pouliot <[email protected]>
* FileStream.cs, MonoIO.cs: For Silverlight 2.0 (NET_2_1) we always
	throw IsolatedStorageException instead of FileNotFoundException and
	DirectoryNotFoundException.


svn path=/trunk/mcs/; revision=111391
2008-08-22 17:40:17 +00:00
Gert Driesen 5d4e8d2ce4 * DirectoryInfo.cs: Added new internal ctor, which takes a bool that
indicates whether the original path should only container the last
part of the directory. Moved logic for determining the Name and
Parent to Initialize method, to allow it to be re-used on
deserialization. Renamed argument names to fix corcompare issues.
Added missing argument checks.
* Directory.cs (CreateDirectoriesInternal): Use internal ctor for
DirectoryInfo to ensure OriginalPath only contains last part of
the directory.
* File.cs: Removed redundant checks from Create. On 2.0 profile, pass
FileOptions to FileStream. Removed redundant directory check from
Delete and modified exceptions to more closely match MS.
* FileInfo.cs: Added argument check to ctor to match MS. Added missing
deserialization ctor. Modified argument checks in MoveTo, and removed
redundant checks. Added missing argument checks in CopyTo. Code
formatting.
* FileSystemInfo.cs: Modified argument checks in CheckPath to more
closely match MS.
* MonoIO.cs: Added msg that does not disclose filename for
ERROR_FILE_EXISTS.
* Path.cs: Use String.Length instead of comparing with String.Empty.
Removed exceptions argument names to match MS.
* File.cs: Added/improved tests for Create and Move.
* DirectoryInfoTest.cs: No longer derive from deprecated Assertion
class. Improved tests for ctor, Create, Name, Parent, ...
* FileInfoTest.cs: No longer derive from deprecated Assertion class.
Improved/added tests, 
* PathTest.cs: Added tests for IsPathRooted and GetFullPath.
* FileSystemInfoTest.cs: Fixed test. Now passes on both Mono and MS.

svn path=/trunk/mcs/; revision=101006
2008-04-17 15:04:25 +00:00
Bill Holmes f18043102f 2007-08-20 William Holmes <[email protected]>
Implementing System.IO.File.Replace
	*File.cs:  Add implementation for IO.File.Replace methods.
	*MonoIO.cs: Declared an internal call for ReplaceFile
	*FileTest.cs:  Added a test for IO.File.Replace.  

	Code is contributed under MIT/X11 license.

svn path=/trunk/mcs/; revision=84485
2007-08-20 18:48:55 +00:00
Dick Porter ced82e1238 2007-07-31 Dick Porter <[email protected]>
* MonoIO.cs: Fix formatting of 'access denied' exception when the
	path info isn't known.  Fixes bug 82141.



svn path=/trunk/mcs/; revision=83096
2007-07-31 15:35:04 +00:00
Dick Porter 37bc149b80 Reinstate this change.
2007-04-05  Dick Porter  <[email protected]>

	* Directory.cs: Pass combined path and pattern to
	MonoIO.GetFileSystemEntries()



svn path=/trunk/mcs/; revision=76250
2007-04-25 13:53:05 +00:00
Dick Porter d162abe1b3 Revert this while I figure out why monodevelop breaks
svn path=/trunk/mcs/; revision=75777
2007-04-16 17:02:22 +00:00
Dick Porter acacb61e04 2007-04-05 Dick Porter <[email protected]>
* Directory.cs: Pass combined path and pattern to
	MonoIO.GetFileSystemEntries()

2007-04-05  Dick Porter  <[email protected]>

	* Environment.cs: Increment mono_corlib_version



svn path=/trunk/mcs/; revision=75432
2007-04-05 12:43:26 +00:00
Dick Porter 025c9917e4 2007-02-22 Dick Porter <[email protected]>
* MonoIOError.cs: 
	* MonoIO.cs: Handle ERROR_CANNOT_MAKE.



svn path=/trunk/mcs/; revision=73322
2007-02-22 16:21:13 +00:00
Dick Porter 096b024496 2006-11-13 Dick Porter <[email protected]>
* Directory.cs: Don't follow symlinks when deleting directories.
        Keeps bug 79733 fixed while fixing bug 79887.

        * MonoIO.cs: ExistsSymlink() added, which checks for
        FileAttributes.ReparsePoint.



svn path=/trunk/mcs/; revision=67767
2006-11-13 17:02:17 +00:00
Miguel de Icaza 2b3a7db7cb 2006-04-26 Miguel de Icaza <[email protected]>
* FileStream.cs: Implement the FileOptions usage by passing all
	the information to the C layer.  Remove the "isAsync" argument for
	MonoIO.Open, and instead pass it on the FileOptions.

	* FileOptions.cs: Make it build when including WriteThrough

	* MonoIO.cs: Update MonoIO.Open signature to drop the async
	argument and take FileOptions instead. 

2006-04-26  Miguel de Icaza  <[email protected]>

	* MethodBuilder.cs: better error messages when we close the
	method. 



svn path=/trunk/mcs/; revision=59960
2006-04-26 23:18:28 +00:00
Joerg Rosenkranz 450e42412f 2006-02-22 Joerg Rosenkranz <[email protected]>
* MonoIO.cs, MonoIOError.cs: Verbose exception for error 39
          (disk full).


svn path=/trunk/mcs/; revision=57155
2006-02-22 14:06:15 +00:00
Kornél Pál b58e211d86 Added DriveNotFoundException.cs. MonoIO.cs: Added ERROR_INVALID_DRIVE handling. Pass HResult to IOException constructors.
svn path=/trunk/mcs/; revision=55102
2006-01-05 14:32:22 +00:00
Sebastien Pouliot 90e63868d2 2005-12-15 Sebastien Pouliot <[email protected]>
* DirectoryInfo.cs: Fixed #76903 where the Name property wasn't 
	correct in some cases. Added special case for Windows drives. Reduced
	temporary allocations in Get* methods (removed ArrayList). Added some
	new 2.0 methods (partial).
	* MonoIO.cs: Removed InvalidPathChars icall as the return value is 
	different from 1.x and 2.0. The values are now defined in Path.cs.
	* Path.cs: Fixed #76191 so that GetFullPath on a Windows drive returns
	the current directory (if it's on the specified drive). Fixed 2.0 API
	changes (e.g. static class).
	* SearchOption.cs: Added missing [Serializable] (2.0).


svn path=/trunk/mcs/; revision=54456
2005-12-15 14:29:34 +00:00
Gonzalo Paniagua Javier 07caf875a3 2005-10-04 Gonzalo Paniagua Javier <[email protected]>
* MonoIO.cs: replace FindFirst/FindNext/FindClose with
	GetFileSystemEntries.
	* Directory.cs: simplify GetFileSystemEntries by using the new icall.


svn path=/trunk/mcs/; revision=51152
2005-10-04 08:20:51 +00:00
Miguel de Icaza 72c74f3667 2005-09-05 Miguel de Icaza <[email protected]>
* MonoType.cs: Patch from Jonathan Chambers to implement
	Type.GUID. 

	* AppDomainSetup.cs: Full-pathization of the appBase should only
	be done on Windows, the ":" condition never applied to Linux.

2005-09-05  Miguel de Icaza  <[email protected]>

	* MonoIOError.cs: expose the ERROR_DIR_NOT_EMPTY as we are
	throwing it. 

	* MonoIO.cs: Return a properly named error.




svn path=/trunk/mcs/; revision=49483
2005-09-05 16:48:02 +00:00
Dick Porter dc2160434e 2005-07-05 Dick Porter <[email protected]>
* MonoIO.cs:
	* MonoIOError.cs: Add error message for ERROR_WRITE_FAULT.


svn path=/trunk/mcs/; revision=46941
2005-07-05 12:19:51 +00:00
Gonzalo Paniagua Javier efb370e629 2005-04-07 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs:
	* MonoIO.cs: remove dead code related to async IO.


svn path=/trunk/mcs/; revision=42667
2005-04-08 00:17:16 +00:00
Gonzalo Paniagua Javier 72ba6e6fee 2005-03-17 Gonzalo Paniagua Javier <[email protected]>
* MonoIO.cs:
	* MonoIOError.cs: handle ERROR_LOCK_VIOLATION.


svn path=/trunk/mcs/; revision=41962
2005-03-17 20:48:04 +00:00
Dick Porter 757c3419eb 2005-03-09 Dick Porter <[email protected]>
* MonoIOError.cs: 
        * MonoIO.cs: Add a few more exception messages



svn path=/trunk/mcs/; revision=41612
2005-03-09 19:51:26 +00:00
Dick Porter 16c9a7a559 2004-11-19 Dick Porter <[email protected]>
* MonoIOError.cs: 
        * MonoIO.cs: Add a proper message for sharing violation



svn path=/trunk/mcs/; revision=36306
2004-11-19 12:13:46 +00:00
Dick Porter 9106dd2968 2004-07-06 Dick Porter <[email protected]>
* MonoIO.cs: Add ERROR_INVALID_PARAMETER to the exception list.
	Don't blow away the SetFileTime() error before the caller gets to
	see it.  Part of the bug fix to 60970.

svn path=/trunk/mcs/; revision=30787
2004-07-06 13:49:44 +00:00
Dick Porter 55e8d9fe73 2004-07-05 Dick Porter <[email protected]>
* CheckPermission.cs:
	* File.cs:
	* FileInfo.cs:
	* MonoIO.cs:
	* FileStream.cs: Give the filename when throwing
	FileNotFoundException.  Fixes bug 61120, based on patch from
	Carlos Alberto Cesario <[email protected]>.

svn path=/trunk/mcs/; revision=30744
2004-07-05 15:05:43 +00:00
Atsushi Eno 5412643255 2004-06-21 Atsushi Enomoto <[email protected]>
* FileStream.cs : Check buffer size before creating file.
	* StreamReader.cs : Check encoding!=null before creating file.
	* File.cs,
	  MonoIO.cs : Convert DateTime to FileTime after checking
	  file IO sharing violation (it just fixes the type of exception).

svn path=/trunk/mcs/; revision=30033
2004-06-21 13:30:46 +00:00
Duncan Mak 13d1764537 Add license and copyright to all source files in corlib
svn path=/trunk/mcs/; revision=29249
2004-06-11 02:09:36 +00:00
Dick Porter d024688825 2004-05-27 Dick Porter <[email protected]>
* MonoIO.cs: Define icalls for Lock() and Unlock()

	* FileStream.cs: Implement Lock() and Unlock().  Also improve IO
	error reporting.

	* FileSystemInfo.cs:
	* File.cs:
	* Directory.cs: Improve IO error reporting

svn path=/trunk/mcs/; revision=28285
2004-05-27 16:25:27 +00:00
Lluis Sanchez a186746a8a * File.cs: In Move, throw IOException instead of ArgumentException if destination
is a directory.
	* MonoIO.cs: In ExistsDirectory, return ERROR_PATH_NOT_FOUND instead of
	  ERROR_FILE_NOT_FOUND, since we are looking for a directory, not a file.

svn path=/trunk/mcs/; revision=24527
2004-03-24 17:24:29 +00:00
Gonzalo Paniagua Javier 9d34f4d930 2004-03-15 Gonzalo Paniagua Javier <[email protected]>
* corlib.dll.sources: added StreamAsyncResult and FileStreamAsyncResult.

	* System/Environment.cs: updated corlib version.

	* System.IO/FileStream.cs: added support for asynchronous I/O without
	using the OS native libraries if available.

	* System.IO/FileStreamAsyncResult.cs: IAsyncResult for asynch. I/O.

	* System.IO/MonoIO.cs: added BeginRead/Write, GetSupportsAsync. Open
	has now a new parameter to tell ifthe file will be used for asynch.
	operations.

	* System.IO/Stream.cs: BeginRead/Write do not use delegates. They just
	are actually synchronous.

	* System.IO/StreamAsyncResult.cs: IAsyncResult for Stream.

	* System.Threading/NativeOverlapped.cs: added 2 new internal fields.
	* System.Threading/Overlapped.cs: implemented, but it's not used.

	* System.Threading/ThreadPool.cs: implemented BindHandle.

svn path=/trunk/mcs/; revision=24069
2004-03-15 21:19:16 +00:00
Gonzalo Paniagua Javier 5628f451d9 2004-03-02 Gonzalo Paniagua Javier <[email protected]>
* MonoIO.cs: added case for ERROR_FILENAME_EXCED_RANGE.

svn path=/trunk/mcs/; revision=23620
2004-03-02 15:16:57 +00:00
Gonzalo Paniagua Javier b930571b08 2004-02-19 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: (.ctor) Path.DirectoryName can be empty and make
	Path.GetFullPath crash. Fixed it.

	* MonoIO.cs: fixed typo.

svn path=/trunk/mcs/; revision=23257
2004-02-19 17:40:35 +00:00
Bernie Solomon 46e79026bd 2003-12-19 Bernie Solomon <[email protected]>
* MonoIO.cs: SetFileTime() Failed Open returns InvalidHandle
	not Zero

svn path=/trunk/mcs/; revision=21375
2003-12-20 05:46:30 +00:00
Ravindra 6dd39c405c Added a new exception case.
svn path=/trunk/mcs/; revision=20815
2003-12-06 09:03:10 +00:00
Gonzalo Paniagua Javier 5fd271c08b 2003-11-15 Gonzalo Paniagua Javier <[email protected]>
* System/Environment.cs: use Directory in CurrentDirectory property.
	We were not throwing any exception when setting the directory to an
	invalid path.

	* System.IO/Directory.cs:
	(GetCurrentDirectory):
	(SetCurrentDirectory): moved here from Environment. Handle error cases.

	* System.IO/MonoIO.cs: add path to the default error message.

svn path=/trunk/mcs/; revision=20032
2003-11-15 13:13:45 +00:00
Paolo Molaro c674f4d94e Fri Jul 18 14:42:42 CEST 2003 Paolo Molaro <[email protected]>
* MonoIO.cs: 64bit fix from Bernie Solomon <[email protected]>.

svn path=/trunk/mcs/; revision=16401
2003-07-18 12:51:51 +00:00
Dick Porter 3797edd7df 2003-05-16 Dick Porter <[email protected]>
* MonoIO.cs: Implement GetTempPath

svn path=/trunk/mcs/; revision=14625
2003-05-16 11:56:32 +00:00
Dick Porter 542709a35c 2002-10-31 Dick Porter <[email protected]>
* FileStream.cs: Fix buffering properly this time.  Also kludge
	around broken pipe errors, treating them as EOF instead of
	throwing an IO exception.

	* MonoIO.cs: Return the error status in a parameter, as the
	GetLastError() value has long since been blown away if we try and
	look it up in a subsequent internal call invocation.

	* Process.cs:
	* Environment.cs:
	* FileSystemInfo.cs:
	* FileInfo.cs:
	* File.cs:
	* Directory.cs: MonoIO methods now have an error parameter

2002-10-31  Dick Porter  <[email protected]>

	* list.unix: Added MonoIO and MonoIOError to the build

svn path=/trunk/mcs/; revision=8712
2002-10-31 15:55:48 +00:00
Dick Porter 3207e426e4 2002-10-23 Dick Porter <[email protected]>
* Process.cs: Redirected standard input needs to have AutoFlush set

2002-10-23  Dick Porter  <[email protected]>

	* FileStream.cs: Implemented CanSeek, and used it around all the
	calls to MonoIO.Seek.  Fixed buffering in Read() so that it
	doesn't block forever on short reads.

	* MonoFileType.cs: New enum for GetFileType

	* MonoIO.cs: Added GetFileType

svn path=/trunk/mcs/; revision=8492
2002-10-23 15:12:26 +00:00
Dick Porter 1efda2a6a0 2002-07-20 Dick Porter <[email protected]>
* Process.cs: Implement file handle redirection

2002-07-20  Dick Porter  <[email protected]>

	* MonoIO.cs: Added icall to CreatePipe

2002-07-20  Dick Porter  <[email protected]>

	* MonoIO.cs: Cut down copy of corlib/System.IO/MonoIO.cs, so it
	can be used from the System assembly but still not be exposed to
	users.

svn path=/trunk/mcs/; revision=5961
2002-07-20 10:30:18 +00:00
Dan Lewis a827553ae1 2002-03-28 Dan Lewis <[email protected]>
* Directory.cs: Throws DirectoryNotFoundException.
	* MonoIO.cs: Fixed to work around enum problem.

svn path=/trunk/mcs/; revision=3434
2002-03-28 07:07:57 +00:00
Dan Lewis d6e7b06471 2002-03-27 Dan Lewis <[email protected]>
corlib/

	* corlib.build: removed seperate windows/linux builds. excluded
	wrapper and PAL classes from all builds.

corlib/System/

	* Console.cs: Modified to get std handles from MonoIO.
	* Environment.cs: removed PAL dependencies.

corlib/System.IO/

	* Directory.cs, File.cs, FileSystemInfo.cs, FileInfo.cs,
	DirectoryInfo.cs, Path.cs: Modified to use MonoIO class instead of
	wrapper and PAL classes.

	* MonoIO.cs, MonoIOStat.cs, MonoIOError.cs: Added.

svn path=/trunk/mcs/; revision=3379
2002-03-27 00:51:39 +00:00