Commit Graph
91 Commits
Author SHA1 Message Date
Atsushi Eno a4039fa632 yuck, typo.
svn path=/trunk/mcs/; revision=90103
2007-11-21 19:15:15 +00:00
Atsushi Eno ac879a3ea0 2007-11-21 Atsushi Enomoto <[email protected]>
* FileStream.cs : Close() does not exist in 2.0 (Stream does).
	  Move GC.SuppressFinalize() to Dispose(true).


svn path=/trunk/mcs/; revision=90095
2007-11-21 17:27:29 +00:00
Marek Safar f8477b12e6 Warnings cleanup
svn path=/trunk/mcs/; revision=89670
2007-11-15 11:51:57 +00:00
Gert Driesen ce9892f0a0 * BinaryReader.cs: Fixed line endings.
* FileStream.cs: Rename name argument to path. Spaces to tabs.

svn path=/trunk/mcs/; revision=84797
2007-08-24 10:51:01 +00:00
Dick Porter 8b2b1773d3 2007-06-21 Dick Porter <[email protected]>
* FileStream.cs: Fix FileShare test, fixing better bug 79250.



svn path=/trunk/mcs/; revision=80493
2007-06-21 16:22:27 +00:00
Jonathan Chambers 98c320154e 2007-05-12 Jonathan Chambers <[email protected]>
* FileStream.cs: Implement SafeHandle constructors.


svn path=/trunk/mcs/; revision=77278
2007-05-12 15:03:37 +00:00
Dick Porter 5b79519900 2007-04-30 Dick Porter <[email protected]>
* Directory.cs: 
	* FileShare.cs: 
	* DirectoryNotFoundException.cs: 
	* SeekOrigin.cs: 
	* FileAttributes.cs: 
	* IOException.cs: 
	* MemoryStream.cs: 
	* FileMode.cs: 
	* BinaryWriter.cs: 
	* TextWriter.cs: 
	* File.cs: 
	* BinaryReader.cs: 
	* TextReader.cs: 
	* UnmanagedMemoryStream.cs: 
	* StringWriter.cs: 
	* FileAccess.cs: 
	* FileLoadException.cs: 
	* BufferedStream.cs: 
	* Stream.cs: 
	* FileInfo.cs: 
	* FileStream.cs:
	* StringReader.cs: 
	* StreamWriter.cs: 
	* EndOfStreamException.cs: 
	* DriveInfo.cs: 
	* StreamReader.cs: 
	* PathTooLongException.cs: 
	* DriveType.cs: 
	* FileNotFoundException.cs: 2.0 profile updates



svn path=/trunk/mcs/; revision=76495
2007-04-30 14:05:12 +00:00
Alp Toker 1f9ae123bc 2007-04-21 Alp Toker <[email protected]>
* FileStream.cs: Respect request for buffering in all cases.

	Gonzalo added code in r42667 that disables buffering even when it is
	requested, in the case that ftype != MonoFileType.Disk. This was
	killing performance for users who do Console.OpenStandardOutput(1024)
	but were ending up with a non-buffered FileStream.

	The new behaviour appears correct but we should watch for any
	regressions.


svn path=/trunk/mcs/; revision=76038
2007-04-21 08:18:30 +00:00
Gert Driesen 6dd8ccef86 * FileStream.cs: Always resolve to absolute paths for exceptions, when not
in anonymous mode.     
* FileStreamTest.cs: Added and improved tests to verify whether the
reported exceptions match that of MS.

svn path=/trunk/mcs/; revision=72048
2007-01-31 19:26:17 +00:00
Paolo Molaro c772628c52 Mon Dec 11 11:40:06 CET 2006 Paolo Molaro <[email protected]>
* FileStream.cs: correct exception message patch from
	Markus Mauhart <[email protected]>.


svn path=/trunk/mcs/; revision=69308
2006-12-11 10:42:05 +00:00
Dick Porter 291d9b1488 2006-10-11 Dick Porter <[email protected]>
* FileStream.cs: Cope with 2.0 FileShare.Delete values.  Patch by
        Peter Dettman <[email protected]> fixing bug 79250.



svn path=/trunk/mcs/; revision=66563
2006-10-11 17:33:14 +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
Zoltan Varga f09ac378d3 2006-04-21 Zoltan Varga <[email protected]>
* FileStream.cs: Add new net 2.0 ctor.

	* FileOptions.cs: New file.

svn path=/trunk/mcs/; revision=59750
2006-04-21 13:43:51 +00:00
Gonzalo Paniagua Javier bc13a1f483 2006-03-21 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: Seek() should flush the buffer, if any. Fixes bug
	#77863.


svn path=/trunk/mcs/; revision=58248
2006-03-21 21:02:39 +00:00
Gert Driesen 201a21a253 * FileStream.cs: To match MSFT, ignore FileShare.Inheritable on 2.0
profile. This fixes bug #77644. Improved usefulness of some existing
exception messages.
* FileStreamTest.cs: Fixed tests for invalid share value to pass on
MS.NET 2.0, and all Mono profiles. Added test that verifies the
correct behavior of all possible FileMode and FileAccess combinations.
Fixed compiler warning.

svn path=/trunk/mcs/; revision=57337
2006-02-27 17:45:07 +00:00
Zoltan Varga 7329f6ac1a 2006-02-03 Zoltan Varga <[email protected]>
* Stream.cs FileStream.cs: Add new 2.0 Dispose () method and protected
	Dispose (bool) method.

svn path=/trunk/mcs/; revision=56524
2006-02-03 14:12:07 +00:00
Kornél Pál 4644c57095 FileStream.cs: Set buf_start to actual initial position when creating FileStreams from handles.
svn path=/trunk/mcs/; revision=54831
2005-12-24 09:00:02 +00:00
Paolo Molaro 46899f36bd Tue May 17 10:54:18 CEST 2005 Paolo Molaro <[email protected]>
* FileStream.cs: complete fix for #74971.


svn path=/trunk/mcs/; revision=44605
2005-05-17 08:17:56 +00:00
Gonzalo Paniagua Javier c44fe05b7c 2005-05-16 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: make WriteByte work in all cases when no buffer is
	being used. Fixes bug #74971.


svn path=/trunk/mcs/; revision=44602
2005-05-16 23:42:13 +00:00
Gonzalo Paniagua Javier 9fd456ac61 warnings
svn path=/trunk/mcs/; revision=43369
2005-04-21 01:15:27 +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
Sebastien Pouliot c9c4705f66 2005-03-24 Sebastien Pouliot <[email protected]>
* Directory.cs: Added a Demand for Read/Write when creating a new 
	directory.
	* FileSystemInfo.cs: Added an InheritanceDemand for Unrestricted on 
	the class.
	* Path.cs: Added a Demand for PathDiscovery in GetFullPath method.
	Added an Assert for unrestricted file access to GetTempFilename as
	the method must create the (zero-length) file and can be called from
	partially trusted code. Added a Demand for unrestricted environment
	access to GetTempPath method.
	* FileStream.cs: Added a Demand for UnmanagedCode for all constructors
	accepting a file handle. Added LinkDemand and InheritanceDemand for 
	UnmanagedCode to get Handle and SafeFileHandle (2.0) properties.


svn path=/trunk/mcs/; revision=42212
2005-03-24 14:12:01 +00:00
Sebastien Pouliot 47e47c7059 2005-03-15 Sebastien Pouliot <[email protected]>
* FileStream.cs: Anonymize part of the path when exceptions are throw
	by a FileStream is used for isolated storage. Throw a DirectoryNotFound
	Exception for any FileMode not just CreateNew (see new unit tests).


svn path=/trunk/mcs/; revision=41855
2005-03-15 21:07:07 +00:00
Sebastien Pouliot 12654abdaa 2005-01-31 Sebastien Pouliot <[email protected]>
* FileStream.cs: Added new constructor to allow anonymous files (i.e.
	when Name property is "[Unknown]") for IsolatedStorage. Added
	SafeFileHandle property and a reference to Microsoft.Win32.SafeHandles
	for the NET_2_0 profile.


svn path=/trunk/mcs/; revision=39861
2005-01-31 18:38:05 +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 d28b4f66c0 2004-06-21 Atsushi Enomoto <[email protected]>
* FileStream.cs :
	  .ctor() should block write access when created with FileAccess.Write.

svn path=/trunk/mcs/; revision=30040
2004-06-21 14:45:01 +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
Duncan Mak 099f56bc86 * BufferedStream.cs (SetLength): Add checks and throw the
appropriate Exceptions here instead.

* FileStream.cs (SetLength): Revert part of my last patch, we're
throwing ObjectDisposedException instead of IOException again.

svn path=/trunk/mcs/; revision=29123
2004-06-09 17:10:54 +00:00
Gonzalo Paniagua Javier 7dcce26259 2004-06-09 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: re-enabled ignoring broken pipe errors when reading.
	Fixes bug #59639.

svn path=/trunk/mcs/; revision=29077
2004-06-09 04:10:30 +00:00
Duncan Mak 9eb61b41c6 * FileStream.cs (SetLength): The other exceptions have precendence
over ObjectDisposedException, which is not one of the exceptions
listed in the documentation). Also, instead of throwing an
ObjectDisposedException, throw an IOException.

* FileStreamTest.cs (SetLengthWithClosedBaseStream): New test for
checking that the correct exception is thrown when the base stream
is closed.

svn path=/trunk/mcs/; revision=28993
2004-06-07 22:24:05 +00:00
Sebastien Pouliot 782aff048c 2004-05-30 Sebastien Pouliot <[email protected]>
* FileStream.cs: Added missing validations.

svn path=/trunk/mcs/; revision=28497
2004-05-30 19:34:26 +00:00
Sebastien Pouliot 50ad571d70 2004-05-30 Sebastien Pouliot <[email protected]>
* BufferedStream.cs: Fixed Seek logic (check for CanSeek and dispose).
	SetLength must also reset Position and check for dispose.
	* FileStream.cs: Added missing check for invalid SeekOrigin.

svn path=/trunk/mcs/; revision=28490
2004-05-30 17:52:35 +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
Gonzalo Paniagua Javier 31172b2d1e 2004-05-27 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: delay seeking to the end when FileMode.Append is
	specified until after buffer initialization. Fixes bug #59151.

svn path=/trunk/mcs/; revision=28222
2004-05-27 04:37:28 +00:00
Sebastien Pouliot 9cd88d39f6 2004-05-26 Sebastien Pouliot <[email protected]>
* BufferedStream.cs: Fixed possible integer overflow.
	* FileStream.cs: Fixed possible integer overflow.
	* MemoryStream.cs: Fixed possible integer overflow.
	* StringReader.cs: Fixed possible integer overflow.

svn path=/trunk/mcs/; revision=28176
2004-05-26 17:40:51 +00:00
Ben Maurer 9ef8c059cf 2004-04-29 Ben Maurer <[email protected]>
* FileStream.cs: constify.

svn path=/trunk/mcs/; revision=26343
2004-04-29 21:34:26 +00:00
Gonzalo Paniagua Javier 87a82df5c4 2004-04-16 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: only pass the async flag set to true when opening the
	file and AIO is supported by the underlying system. Fixes bug #56883.

svn path=/trunk/mcs/; revision=25597
2004-04-16 10:53:06 +00:00
Lluis Sanchez e84bdd437f * FileStream.cs: ReadByte(): when buffering is disabled, read the byte with
a direct call to ReadData. In InitBuffer(), if buffering is disabled,
	  create a buffer of one byte, to be used in ReadByte.
	  This fixes bug #52361.

svn path=/trunk/mcs/; revision=24589
2004-03-25 14:35:31 +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 4083e2eb85 2004-02-24 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: remove dangling ^Ms.

svn path=/trunk/mcs/; revision=23387
2004-02-24 00:42:25 +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
Jackson Harper 7463890afc * FileStream.cs: Throw some more exceptions for invalid
params. Fixes some unit test failures.
	* BufferedStream.cs: If the stream is closed (can't read from it
	or write to it) throw an ObjectDisposedException.

svn path=/trunk/mcs/; revision=23074
2004-02-13 20:14:53 +00:00
Ben Maurer 7d70e5b72e 2004-01-18 Ben Maurer <[email protected]>
* FileStream.cs: Locking from bug #32344 removed. This is not
	necessary because the correct fix was actually in the console.
	This fixes bug #53026. Miguel de Icaza reviewed/approved this
	patch.

svn path=/trunk/mcs/; revision=22224
2004-01-18 17:26:04 +00:00
Zoltan Varga a86c96441e 2004-01-14 Zoltan Varga <[email protected]>
* FileStream.cs (.ctor): Avoid allocating a large buffer when reading
	from small files.

svn path=/trunk/mcs/; revision=22058
2004-01-14 14:55:46 +00:00
Bernie Solomon 6880ebfe67 Initialize handle to InvalidHandle as well
svn path=/trunk/mcs/; revision=21440
2003-12-23 03:25:48 +00:00
Bernie Solomon 7b9484378a 2003-12-22 Bernie Solomon <[email protected]>
* FileStream.cs: (.ctor) do not set handle
	in object until after it is validated via
	GetFileType so finalizer doesn't see bad handles

svn path=/trunk/mcs/; revision=21437
2003-12-23 00:35:41 +00:00
Gonzalo Paniagua Javier 6e323452f6 2003-11-14 Gonzalo Paniagua Javier <[email protected]>
* FileStream.cs: use the argument name when throwing exception.

	* StreamReader.cs:
	* StringReader.cs:
	* TextReader.cs: added [In] attribute for the array in Read.

svn path=/trunk/mcs/; revision=19987
2003-11-14 04:06:38 +00:00
Miguel de Icaza b6761866e4 2003-10-20 Miguel de Icaza <[email protected]>
* FileStream.cs public FileStream (string name, FileMode mode)
	constructor: If we pass FileMode.Append, we can not pass
	FileAccess.ReadWrite.  This fixes bug 44959

svn path=/trunk/mcs/; revision=19215
2003-10-20 19:09:39 +00:00
Lluis Sanchez 965b3402a0 * BufferedStream.cs, FileStream.cs, MemoryStream.cs, Stream.cs:
Added [In,Out] attributes to Read method.

svn path=/trunk/mcs/; revision=18042
2003-09-11 23:44:33 +00:00