Commit Graph
63 Commits
Author SHA1 Message Date
Jb Evain 0eb1105589 2007-11-12 Juraj Skripsky <[email protected]>
* Path.cs (GetRandomFileName): Return filenames containing only
	characters from the range [a..z0..9] as MS.NET does. 


svn path=/trunk/mcs/; revision=89869
2007-11-17 19:29:36 +00:00
Miguel de Icaza c97c647b23 2007-11-01 Miguel de Icaza <[email protected]>
* Path.cs (GetDirectoryName): The paths returned from this routine
	should be canonical, not just a substring.   In addition to fixing
	this, it also fixes #324742.

svn path=/trunk/mcs/; revision=88708
2007-11-02 03:47:10 +00:00
Miguel de Icaza 937185f945 2007-03-05 Miguel de Icaza <[email protected]>
* Path.cs: Manually call FileStream and pass the new internal
	FileOptions.1 flag that means "This is a temporary file, use 600
	permissions". 

	* FileOptions.cs: Document the new private enum value.

svn path=/trunk/mcs/; revision=73771
2007-03-06 00:46:44 +00:00
Boris Kirzner e186082db9 Fix order of InvalidPathChars on windows.
svn path=/trunk/mcs/; revision=73099
2007-02-19 09:25:40 +00:00
Miguel de Icaza 3a23274a17 Revert Patch 72756 until we review and discuss this publicly
svn path=/trunk/mcs/; revision=72768
2007-02-13 13:07:41 +00:00
Boris Kirzner 04052b1827 Path handling fixes in File, Directory and Path including windows-specific negative flows.
svn path=/trunk/mcs/; revision=72756
2007-02-13 12:04:32 +00:00
Sebastien Pouliot f36b6a460c 2006-08-21 Sebastien Pouliot <[email protected]>
* Path.cs: Added internal method IsPathSubsetOf required to implement
	correctly FileIOPermission (better located here).


svn path=/trunk/mcs/; revision=64144
2006-08-21 14:28:27 +00:00
John Luke 3a334d1bcc 2006-06-03 John Luke <[email protected]>
* Path.cs: fix typo in [Obsolete] message


svn path=/trunk/mcs/; revision=61431
2006-06-03 15:50:07 +00:00
Atsushi Eno 48a3a32616 2006-04-28 Robert Jordan <[email protected]>
* Path.cs (GetPathRoot): Return just the \\server\share
	part of a UNC. Fixes #78147.

2006-04-28  Robert Jordan  <[email protected]>

	* PathTest.cs: Added tests for bug #78147.


svn path=/trunk/mcs/; revision=60033
2006-04-28 12:52:40 +00:00
Atsushi Eno 2b28efb524 2006-01-18 Atsushi Enomoto <[email protected]>
* Path.cs : (GetRandomFileName) use random buffer ;-) It somehow
	  caused infinite loop on Windows.


svn path=/trunk/mcs/; revision=55712
2006-01-18 09:09:41 +00:00
Sebastien Pouliot ed1db80b43 2006-01-11 Sebastien Pouliot <[email protected]>
* Path.cs: Previous fix caused regression of bug #76191. Fixed (again)


svn path=/trunk/mcs/; revision=55399
2006-01-11 21:28:52 +00:00
Sebastien Pouliot 3e688a1ef1 2006-01-09 Sebastien Pouliot <[email protected]>
* Path.cs: Fix c14n on Windows when the first separator after the root
	isn't '\'. Fix problems for XSP with 1.1.13.


svn path=/trunk/mcs/; revision=55260
2006-01-09 21:10:46 +00:00
Miguel de Icaza d9914fe6a5 2006-01-07 Miguel de Icaza <[email protected]>
* Path.cs (GetTempFilename): Append ".tmp" to the path, some
	external application expect this extension.

svn path=/trunk/mcs/; revision=55185
2006-01-07 13:37:32 +00:00
Sebastien Pouliot 7b2845a3b1 2005-12-21 Sebastien Pouliot <[email protected]>
* Path.cs: Fixed #77058 where a Windows drive wasn't considered during
	path canonalization.


svn path=/trunk/mcs/; revision=54713
2005-12-22 01:54:10 +00:00
Sebastien Pouliot 4ad0590f29 2005-12-20 Sebastien Pouliot <[email protected]>
* Path.cs: Fixed #77007 where a Windows drive is specified with a 
	partial path.


svn path=/trunk/mcs/; revision=54701
2005-12-21 20:18:19 +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 16ad584f51 2005-04-13 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: don't trim the path in CanonicalizePath on non-windows
	systems. Fixes bug #53173.


svn path=/trunk/mcs/; revision=42970
2005-04-13 23:03:14 +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
Ben Maurer fd21f0bca0 2004-09-05 Ben Maurer <[email protected]>
* Path.cs (Combine): Array.IndexOf is slow (because of the
	special cases it must handle). So, rather than doing IndexOf
	just check each type of seperator.

svn path=/trunk/mcs/; revision=33375
2004-09-05 18:28:49 +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 263c2985a7 2004-05-22 Duncan Mak <[email protected]>
* Directory.cs: Reformat the whole file to use Unix line endings
	for consistency.
	(GetFileSystemEntries): If pattern is String.Empty, always
	return an empty string array. Throw the ArgumentException if path
	is an empty string (determined using the new helper method)
	(IsEmptyString): Returns true on an empty string or a string with
	only whitespace characters.

	* Path.cs (GetPathRoot): Throw an ArgumentException if the path
	argument is String.Empty.

svn path=/trunk/mcs/; revision=27990
2004-05-24 18:45:35 +00:00
Ben Maurer 8bdd07e8bd 2004-04-29 Ben Maurer <[email protected]>
* Path.cs: readonlyificate.

svn path=/trunk/mcs/; revision=26344
2004-04-29 21:36:40 +00:00
Atsushi Eno 4413a675d8 2003-04-03 Atsushi Enomoto <[email protected]>
* Path.cs : ChangeExtension() does not remove dot(.) when extension is
	  an empty string.

svn path=/trunk/mcs/; revision=24986
2004-04-02 23:29:30 +00:00
Lluis Sanchez b2284676c9 * Path.cs: In GetDirectoryName, fixed check for volumeSeparator. This
fixes bug #53892.

svn path=/trunk/mcs/; revision=24582
2004-03-25 11:44:40 +00:00
Gonzalo Paniagua Javier eee100ef9f 2004-01-20 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: now Path.GetFullPath ("/") returns "/" instead of "".

svn path=/trunk/mcs/; revision=22291
2004-01-20 08:35:27 +00:00
Gonzalo Paniagua Javier 0af28c3a1b 2004-01-20 Gonzalo Paniagua Javier <[email protected]>
* System.IO/Path.cs: add the trailing directory separator only for
	volumes. Fixes bug #53035.
	* Test/System.IO/PathTest.cs: tests for bug 53035 and 52735.

svn path=/trunk/mcs/; revision=22283
2004-01-20 05:24:31 +00:00
Atsushi Eno e5e8b92127 2004-01-10 Atsushi Enomoto <[email protected]>
* Path.cs : GetDirectoryName ("c:\readme.txt") should return "c:\"
	  instead of "c:" . This fixed bug #52735.

svn path=/trunk/mcs/; revision=21911
2004-01-10 18:07:11 +00:00
Nick Drochak 67bd4ec125 2004-01-04 Nick Drochak <[email protected]>
* Path.cs: Remove defined but unused variable, and also got rid of
	some unreachable code.  Eliminates some build warnings.

svn path=/trunk/mcs/; revision=21674
2004-01-04 14:35:50 +00:00
Atsushi Eno 24b8ecd2c5 2003-12-25 Atsushi Enomoto <[email protected]>
* Path.cs : Fixed GetFullPath() (and CanonicalizePath()),
	  HasExtension(), GetPathRoot() and IsPathRooted() to fit with tests.

svn path=/trunk/mcs/; revision=21489
2003-12-25 08:48:46 +00:00
Gonzalo Paniagua Javier 75c6e7a683 2003-12-12 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: GetTempPath () ends with DirectorySeparatorChar. Fixes bug
	#52056.

svn path=/trunk/mcs/; revision=21061
2003-12-12 07:26:48 +00:00
Dick Porter f204bdc417 Do string compares with the Invariant culture.
Use the char forms of IndexOf and LastIndexOf, so that the comparison is
done with the Invariant culture.

svn path=/trunk/mcs/; revision=20593
2003-11-28 18:22:08 +00:00
Gonzalo Paniagua Javier 9f88f4eefb 2003-05-23 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: fixed bug #42631.

svn path=/trunk/mcs/; revision=14820
2003-05-23 02:29:57 +00:00
Gonzalo Paniagua Javier 923769916a 2003-05-14 Gonzalo Paniagua Javier <[email protected]>
* DirectoryInfo.cs: fixed bug #42991.
	* Path.cs:
	(CanonicalizePath): store the value of the trimmed input string. Make it
	work with paths such as "/home/xxx/.".

svn path=/trunk/mcs/; revision=14585
2003-05-14 18:30:11 +00:00
Ben Maurer 9efcf7d116 2003-05-08 Ben Maurer <[email protected]>
* Path.cs
	(CanonicalizePath) Fixed bug #42631, which duplicated the
	root part of the path under Windows.

svn path=/trunk/mcs/; revision=14412
2003-05-09 02:06:31 +00:00
Ben Maurer 347a32ffdd 2003-05-07 Ben Maurer <[email protected]>
* Path.cs
	(GetPathRoot) Added support for UNC paths.
	(CanonicalizePath) Added optimizations per Miguel's requests.
	* PathTest.cs
	Even more GetFullPath () tests. Includes UNC tests.

svn path=/trunk/mcs/; revision=14383
2003-05-08 03:08:52 +00:00
Ville Palo aa71caf8c6 2003-05-06 Ville Palo <[email protected]>
* BufferedStream.cs:
	  - Removed unusefull code.
	  - Added ObjectDisposedException to Position
	  - Dont flush if stream is allready closed.
	  - Flush throws also ObjectDisposedException.
	* Directory.cs:
	  - GetFileSystemEtries: ArgumentNullException if pattern is null
	* DirectoryInfo.cs: Fixed little MoveTo () bug.
	* FileInfo.cs:
	  - Exists: If file does not exists when instance is created the
	  value of the Exists property does not change even if file is created
	  afterwards.
	  - Delete: If path is a directory UnauthorizedException is thrown.
	  - CopyTo: Now we can overwrite file if wanted.
	* Path.cs:
	  - GetFullPath: Now throws exception when path is "   ".

svn path=/trunk/mcs/; revision=14370
2003-05-07 14:43:29 +00:00
Ben Maurer 0040417501 * Directory.cs (GetLogicalDrives) Marked as MonoTODO
because we need to implement the method on Windows.
* Path.cs
	(CanonicalizePath) Added new function to get
	rid of . and .. in path names. Need to figure out what
	other functions should call this.
	(GetFullPath) Added call to the above function. Fixes
	bug 42303

svn path=/trunk/mcs/; revision=14314
2003-05-05 23:07:20 +00:00
Nick Drochak d52315c312 2003-03-31 Nick Drochak <[email protected]>
* Path.cs (GetDirectoryName): Throw proper execption when path is empty.

svn path=/trunk/mcs/; revision=12979
2003-03-31 14:35:33 +00:00
Gonzalo Paniagua Javier 875ad2454d 2003-03-02 Gonzalo Paniagua Javier <[email protected]>
* DirectoryInfo.cs: changed ToString to match MS behavior.
	* Path.cs: further fixes to GetDirectoryName to return null in the
	same cases that MS does.

	Fixes bug #38387.

svn path=/trunk/mcs/; revision=12105
2003-03-02 17:18:51 +00:00
Gonzalo Paniagua Javier d4182fdfac 2003-03-02 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: fixed a couple of bugs reported in #35906.

svn path=/trunk/mcs/; revision=12104
2003-03-02 16:42:52 +00:00
Gonzalo Paniagua Javier aa7ae681b0 2003-01-24 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: fixlet to ChangeExtension for the case when the path is
	empty.

svn path=/trunk/mcs/; revision=10880
2003-01-24 19:09:28 +00:00
Gonzalo Paniagua Javier 941d4611e3 2002-10-06 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: some cleanup. Thanks to Martin Aliger.

svn path=/trunk/mcs/; revision=8051
2002-10-07 18:53:49 +00:00
Gonzalo Paniagua Javier eb1afd1400 2002-10-02 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: fixes bug #28046.

svn path=/trunk/mcs/; revision=7941
2002-10-02 14:55:11 +00:00
Gonzalo Paniagua Javier ac893ff6f1 2002-08-29 Gonzalo Paniagua Javier <[email protected]>
* CheckArgument.cs: fixed check for empty string.
	* Path.cs: various fixes. It passes all the tests in new PathTest.

svn path=/trunk/mcs/; revision=7137
2002-08-29 11:41:48 +00:00
Miguel de Icaza f7cd19e933 2002-08-24 Miguel de Icaza <[email protected]>
* Path.cs (GetTempFileName): Make this routine atomic by not
	testing and then creating, but using the create call to ensure
	that we own the filename.

svn path=/trunk/mcs/; revision=7014
2002-08-24 23:59:54 +00:00
Miguel de Icaza 8c50416580 2002-08-21 Miguel de Icaza <[email protected]>
* Environment.cs: Implemented OSVersion property.

2002-08-21  Miguel de Icaza  <[email protected]>

	* Path.cs (GetDirectoryName): Fix for filenames with size = 1

	* File.cs: Removed all references that threw exceptions when the
	paths contains a colon, as this is a valid part of an identifier
	on Unix.

	Everywhere: The String.Empty return from GetDirectoryName means
	that there is no directory information about the path.

svn path=/trunk/mcs/; revision=6868
2002-08-21 23:38:23 +00:00
Gonzalo Paniagua Javier abc4da1355 2002-07-17 Gonzalo Paniagua Javier <[email protected]>
* Path.cs: removed unneeded line from GetExtension.

svn path=/trunk/mcs/; revision=5866
2002-07-17 16:08:50 +00:00
Dietmar Maurer 787f9a9131 2002-06-17 Dietmar Maurer <[email protected]>
* Path.cs (ChangeExtension): handle some special cases (fixes bug #25319)

svn path=/trunk/mcs/; revision=5311
2002-06-17 12:36:07 +00:00
Nick Drochak eda2a59d10 2002-05-15 Nick Drochak <[email protected]>
* Path.cs (GetDirectoryName): Return String.Empty if there is no
	directory

	* StreamReader.cs: Add some parameter checking on file names.

	* StreamWriter.cs: Add some parameter checking on file names.

svn path=/trunk/mcs/; revision=4626
2002-05-14 11:46:20 +00:00
Nick Drochak 5374cbe27d 2002-05-14 Nick Drochak <[email protected]>
* File.cs: Add parameter checks to most methods. Not completely done,
	but all current unit tests pass.

	* Path.cs: Implement GetTempFileName().

svn path=/trunk/mcs/; revision=4621
2002-05-14 10:40:23 +00:00