Commit Graph
536 Commits
Author SHA1 Message Date
Gonzalo Paniagua Javier 45db947ccc 2010-05-27 William Holmes <[email protected]>
* Directory.cs (ValidateDirectoryListing): Removing an unnecessary
	Path.Combine call. Part of the fix for bug #580090.

	Code is contributed under MIT/X11 license.


svn path=/trunk/mcs/; revision=159860
2010-07-04 16:41:33 +00:00
Rolf Bjarne Kvinge 1302ff5653 2010-06-18 Rolf Bjarne Kvinge <[email protected]>
* FileStream.cs: Include a required ctor in NET_2_1 so that it compiles.

svn path=/trunk/mcs/; revision=159112
2010-06-17 23:47:06 +00:00
Marek Habersack 7312d09305 2010-05-20 Marek Habersack <[email protected]>
* FileStream.cs: when running on Windows and a path with Unix
	directory separator chars is passed (including an UNC share), get
	the canonical form of the path before attempting to retrieve its
	directory name. Fixes bug #607502

	* Path.cs: typo fix

svn path=/trunk/mcs/; revision=157650
2010-05-20 21:54:22 +00:00
Marek Habersack 5aa256010e 2010-05-08 Marek Habersack <[email protected]>
* Path.cs: vararg overload of Combine now correctly concatenates
	segments.
	The 3 and 4 argument overloads of Combine check whether the passed
	segments are null or not.

2010-05-08  Marek Habersack  <[email protected]>

	* PathTest.cs: added tests for the 4.0 Combine overloads.

svn path=/trunk/mcs/; revision=156928
2010-05-07 23:00:28 +00:00
Gonzalo Paniagua Javier ab075382d5 2010-05-05 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: prevent infinite loop when TMPDIR (or equivalent)
	points to a non-existent directory.


svn path=/trunk/mcs/; revision=156704
2010-05-05 04:08:49 +00:00
Sebastien Pouliot eebe81e4e0 2010-04-21 Sebastien Pouliot <[email protected]>
* FileSystemInfo.cs: Ensure elevated trust when calling [Creation
	|LastAccess|LastWrite]Time setters

svn path=/trunk/mcs/; revision=155872
2010-04-21 13:25:55 +00:00
Sebastien Pouliot 3a383eff31 2010-04-21 Sebastien Pouliot <[email protected]>
* FileInfo.cs: Ensure elevated trust when calling Delete on 
	Moonlight.


svn path=/trunk/mcs/; revision=155869
2010-04-21 12:40:57 +00:00
Sebastien Pouliot e6fd69e444 2010-04-16 Sebastien Pouliot <[email protected]>
* Directory.cs: Ensure elevated trust when calling on 
	Moonlight.
	* DirectoryInfo.cs: Ensure elevated trust when calling a .ctor 
	on Moonlight.
	* File.cs: Ensure elevated trust when calling a .ctor on 
	Moonlight.
	* FileInfo.cs: Ensure elevated trust when calling a .ctor on 
	Moonlight.
	* FileStream.cs: Ensure elevated trust when calling a .ctor on 
	Moonlight. Name property returns "[Unknown]" unless a Moonlight
	application is executed with elevated trust.
	* Path.cs: Ensure elevated trust when calling a GetTempPath,
	GetTempFileName or GetFullPath on Moonlight. Add a shared 
	internal method to validate paths to reduce code duplication.


svn path=/trunk/mcs/; revision=155643
2010-04-16 17:29:07 +00:00
Jb Evain 69519131eb 2010-04-15 Jb Evain <[email protected]>
* Directory.cs: don't fully qualify name when not it's necessary.


svn path=/trunk/mcs/; revision=155497
2010-04-15 11:56:06 +00:00
Sebastien Pouliot c02f14af40 2010-03-29 Sebastien Pouliot <[email protected]>
* DirectoryInfo.cs, FileInfo.cs: Moonlight needs the default ctor
	to decorate them with [SecuritySafeCritical] for corclr 
	inheritance rules


svn path=/trunk/mcs/; revision=154364
2010-03-29 11:56:03 +00:00
Gonzalo Paniagua Javier 51f4b1ce2d 2010-03-25 Gonzalo Paniagua Javier <[email protected]>
* Directory.cs: a directory named ":" is legal in unix.
	This gets rid of the annoying ":" folder when running
	corlib tests.


svn path=/trunk/mcs/; revision=154189
2010-03-25 05:39:05 +00:00
Sebastien Pouliot 5012b755ff 2010-03-22 Sebastien Pouliot <[email protected]>
* Directory.cs, DirectoryInfo.cs: Disble new NET_4_0 API used in
	SL4 until we have elevated trust working correctly (since they 
	are *not* decorated as [SecurityCritical])


svn path=/trunk/mcs/; revision=153968
2010-03-22 11:53:14 +00:00
Gonzalo Paniagua Javier ea76aa9964 2010-03-17 Gonzalo Paniagua Javier <[email protected]>
* StreamReader.cs: if the detected encoding is different from the
	provided to the constructor, adjust the decoded buffer size if
	needed. Fixes bug #589236.


svn path=/trunk/mcs/; revision=153799
2010-03-18 02:41:08 +00:00
Sebastien Pouliot a30f25fd2f 2010-03-17 Sebastien Pouliot <[email protected]>
* Stream.cs: CopyTo methods are part of SL4 too


svn path=/trunk/mcs/; revision=153726
2010-03-17 11:56:17 +00:00
Jb Evain 05a5b21fa0 use MOONLIGHT symbol
svn path=/trunk/mcs/; revision=153656
2010-03-16 12:10:19 +00:00
Rolf Bjarne Kvinge f66b3edf96 2010-03-16 Rolf Bjarne Kvinge <[email protected]>
* Path.cs:
	* Directory.cs:
	* DirectoryInfo.cs: Add some of the 4.0 methods to Moonlight.

svn path=/trunk/mcs/; revision=153650
2010-03-16 10:47:36 +00:00
Rolf Bjarne Kvinge d3720a7ca2 2010-03-15 Rolf Bjarne Kvinge <[email protected]>
* SearchOption.cs: Make public for Moonlight, this type is in SL4.

svn path=/trunk/mcs/; revision=153581
2010-03-15 14:32:01 +00:00
Sebastien Pouliot 0b7db61902 In System:
2010-03-12  Sebastien Pouliot  <[email protected]>

	* Tuple.cs, Tuples.cs: Add them to NET_2_1 since they are parts
	of SL4

In System.Collections:
2010-03-12  Sebastien Pouliot  <[email protected]>

	* IStructuralComparable.cs, IStructuralEquatable.cs: Add them to
	NET_2_1 since they are parts of SL4

In System.IO:
2010-03-12  Sebastien Pouliot  <[email protected]>

	* File.cs: Enable some NET_4_0 features in NET_2_1 since they are
	part of SL4. Throw a SecurityException in Moonlight in non-debug
	builds until we're ready for elevated trust.


svn path=/trunk/mcs/; revision=153506
2010-03-12 13:11:11 +00:00
Zoltan Varga cd6e00fab3 2010-03-11 Zoltan Varga <[email protected]>
* Path.cs (GetTempFileName): Fix infinite loop if the process doesn't have
	write access to /tmp. Fixes #585017.

svn path=/trunk/mcs/; revision=153433
2010-03-11 00:49:37 +00:00
Carlos Alberto Cortez 8b0f2bebd5 2010-02-22 Carlos Alberto Cortez <[email protected]>
* MemoryStream.cs: When setting Capacity, don't create a new buffer if
	the new expected value is the same as the current one.


svn path=/trunk/mcs/; revision=152217
2010-02-22 22:23:49 +00:00
Gonzalo Paniagua Javier 21350653cc 2010-02-15 Gonzalo Paniagua Javier <[email protected]>
* StreamWriter.cs:
	* FileStream.cs: if flushing fails when disposing the stream, make
	sure it is closed before throwing the exception. Fixes bug #579146.


svn path=/trunk/mcs/; revision=151761
2010-02-16 01:39:56 +00:00
Zoltan Varga aa4d0babe2 2010-01-31 Zoltan Varga <[email protected]>
* Directory.cs (Exists): Never throw an exception. Fixes #565152.

svn path=/trunk/mcs/; revision=150605
2010-01-31 19:17:34 +00:00
Gonzalo Paniagua Javier e14a2279b2 2010-01-28 Gonzalo Paniagua Javier <[email protected]>
* UnmanagedMemoryStream.cs: fix a regression from my previous patch.


svn path=/trunk/mcs/; revision=150507
2010-01-28 23:01:51 +00:00
Marek Habersack ac1edece76 2010-01-26 Marek Habersack <[email protected]>
* net_2_1_raw_corlib.dll.sources: added System.IO/SearchOption.cs
	to fix the build.

2010-01-26  Marek Habersack  <[email protected]>

	* SearchOption.cs: included in 2.1 build as internal to fix
	the build.

svn path=/trunk/mcs/; revision=150207
2010-01-26 11:53:03 +00:00
Gonzalo Paniagua Javier a5494a7e91 2010-01-25 Gonzalo Paniagua Javier <[email protected]>
* DirectoryInfo.cs: new overload for GetFileSystemInfos().


svn path=/trunk/mcs/; revision=150164
2010-01-26 00:13:15 +00:00
Gonzalo Paniagua Javier 911170c693 2010-01-25 Gonzalo Paniagua Javier <[email protected]>
* UnmanagedMemoryStream.cs: add the SafeBuffer overloads.


svn path=/trunk/mcs/; revision=150162
2010-01-25 23:36:49 +00:00
Carlos Alberto Cortez 542171144b 2010-01-23 Carlos Alberto Cortez <[email protected]>
* StreamReader.cs: When detecting the encoding we usually check the
	four first bytes looking for either UTF32 or UTF8 BOM, since they share
	the first two bytes, but if we happen to have less than 4 bytes at
	detection time, just check for Unicode and use it as the current
	encoding - this is exactly what .Net does, and it is specially visible
	with NetworkStream.
	Fixes #534137.


svn path=/trunk/mcs/; revision=150090
2010-01-24 04:07:35 +00:00
Alan McGovern dd3b6549b4 2010-01-19 Alan McGovern <[email protected]>
* BufferedStream.cs: Patch by Tom Philpot to optimise ReadByte
        * and
        WriteByte significantly by making them fulfill their request by
        directly reading from the buffer.


svn path=/trunk/mcs/; revision=149799
2010-01-19 11:27:01 +00:00
Rolf Bjarne Kvinge 837adb6a21 2010-01-14 Rolf Bjarne Kvinge <[email protected]>
* UnmanagedMemoryStream.cs: Read: don't read bytes one-by-one, read all
	at once.

svn path=/trunk/mcs/; revision=149555
2010-01-14 13:17:53 +00:00
Carlos Alberto Cortez 992a4b5afc 2010-01-03 Carlos Alberto Cortez <[email protected]>
* MemoryStream.cs: Don't clear the bytes beyond Length when shrinking
	it. Instead just save the related information for it and do it when
	Length grows and touchs that dirty region. Refactor the code where
	needed to avoid duplication as well.
	Fixes #327053.


svn path=/trunk/mcs/; revision=148995
2010-01-04 03:46:31 +00:00
Sebastien Pouliot ad24f7d093 2009-12-21 Sebastien Pouliot <[email protected]>
* File.cs (ReadAllBytes): We cannot assume that a single call to
	Read will return all the data we require.


svn path=/trunk/mcs/; revision=148822
2009-12-21 22:40:25 +00:00
Marek Safar 6bec77af06 2009-11-24 Marek Safar <[email protected]>
* StreamReader.cs, FileStream.cs: Use recycle buffer to avoid
	repeated underlying buffer initialization (saves hefty 10MB
	during corlib compilation).
	
	* Path.cs (InsecureGetFullPath): Avoid CanonicalizePath in common
	path.


svn path=/trunk/mcs/; revision=146841
2009-11-24 16:30:55 +00:00
Miguel de Icaza 285e89d96a Add new overloads
svn path=/trunk/mcs/; revision=146707
2009-11-23 07:22:20 +00: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
Marek Safar 2f4c373009 2009-11-13 Marek Safar <[email protected]>
* UnmanagedMemoryAccessor.cs: Finished.


svn path=/trunk/mcs/; revision=146159
2009-11-13 16:24:06 +00:00
Miguel de Icaza 8363715456 svn path=/trunk/mcs/; revision=145672 2009-11-08 18:23:53 +00:00
Miguel de Icaza a22ee129a0 svn path=/trunk/mcs/; revision=145671 2009-11-08 18:16:21 +00:00
Miguel de Icaza e9eafddcd6 2009-11-07 Miguel de Icaza <[email protected]>
* UnmanagedMemoryStream.cs: Move the CLS attribute to the methods
	that are unsafe.

	* Path.cs (Combine):e Fix implementation to follow docs (we need
	to reset the path if any of the combined paths is rooted), and add a
	couple of overloads;

	* FileStream.cs (Flush/flushToDisk): Implement.

	* Stream.cs (CopyTo): Implement.



svn path=/trunk/mcs/; revision=145640
2009-11-07 07:09:10 +00:00
Miguel de Icaza 71b0cb003e 2009-11-03 Miguel de Icaza <[email protected]>
* FileStream.cs: Check the return value of MonoIO.Write and handle
	short-writes as those can happen when a FileStream is used on top
	of a pipe on Unix.

	Fixes bug: #531613, this should be backported to 2-4 and 2-6 after
	some testing.

svn path=/trunk/mcs/; revision=145271
2009-11-03 05:34:06 +00:00
Sebastien Pouliot 962a415e42 2009-10-29 Sebastien Pouliot <[email protected]>
* FileStream.cs: Reduce code duplication by merging FillBuffer 
	with FillBufferToStream


svn path=/trunk/mcs/; revision=145008
2009-10-29 12:09:47 +00:00
Sebastien Pouliot 01721e7fa2 2009-10-28 Sebastien Pouliot <[email protected]>
* FileStream.cs: Move code to deal with 'anonymous' filenames
	into two methods (returning the path, fullpath or only the 
	filename). Default Moonlight to anonymous (not only for isolated
	storage) unless the coreclr is disable (e.g. smcs)


svn path=/trunk/mcs/; revision=144945
2009-10-28 13:42:05 +00:00
Miguel de Icaza 53e7b9d5b6 2009-10-21 Miguel de Icaza <[email protected]>
* BinaryWriter.cs, BinaryReader.cs: 4.0 signature update.

	* File.cs (ReadLines, AppendAllLines, WriteAllLines): Add
	IEnumerable methods.

	* Path.cs (Combine): add the params overload. 

svn path=/trunk/mcs/; revision=144597
2009-10-22 03:19:06 +00:00
Sebastien Pouliot 47f90fc316 In Test/System.IO:
2009-10-15  Sebastien Pouliot  <[email protected]>

	* UnmanagedMemoryStreamTest.cs: Add more test cases to cover all
	validations

In System.IO:
2009-10-15  Sebastien Pouliot  <[email protected]>

	* UnmanagedMemoryStream.cs: Fix some and add missing validations


svn path=/trunk/mcs/; revision=144226
2009-10-15 20:18:40 +00:00
Sebastien Pouliot 4cfb97dff5 fix smcs with utf32 encoded files
svn path=/trunk/mcs/; revision=142544
2009-09-24 01:19:05 +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
Sebastien Pouliot 5574bdb8b5 2009-09-22 Sebastien Pouliot <[email protected]>
* StreamReader.cs: Don't use UTF32 under NET_2_1


svn path=/trunk/mcs/; revision=142392
2009-09-22 13:13:56 +00:00
Sebastien Pouliot 2203a2bb29 2009-09-18 Sebastien Pouliot <[email protected]>
* Directory.cs: Avoid imperative CAS checks and remove 
	AccessControl types for NET_2_1
	* DirectoryInfo.cs: Remove AccessControl types for NET_2_1
	* File.cs: Remove AccessControl types for NET_2_1
	* FileInfo.cs: Remove AccessControl types for NET_2_1
	* FileStream.cs: Remove AccessControl types for NET_2_1
	* Path.cs: Avoid imperative CAS checks for NET_2_1


svn path=/trunk/mcs/; revision=142197
2009-09-18 15:57:32 +00:00
Gonzalo Paniagua Javier 93e506d40e 2009-09-17 Gonzalo Paniagua Javier <[email protected]>
* DirectoryInfo.cs: throw if FullPath is not a directory.
	Fixes bug #539791.


svn path=/trunk/mcs/; revision=142092
2009-09-17 04:36:06 +00:00
Zoltan Varga bc4360c4a2 2009-09-04 Zoltan Varga <[email protected]>
* UnmanagedMemoryAccessor.cs: New net 4.0 class.

svn path=/trunk/mcs/; revision=141373
2009-09-04 21:50:00 +00:00