Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • r65801 - trunk/mcs/class/corlib/System.IO

    0 answers - 8749 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Author: gonzalo
    Date: 2006-09-21 22:50:24 -0400 (Thu, 21 Sep 2006)
    New Revision: 65801
    Modified:
    Log:
    2006-09-21 Gonzalo Paniagua Javier <gonzalo (AT) ximian (DOT) com>
    * FileInfo.cs: eol-style.
    Modified:
    2006-09-22 01:16:12 UTC (rev 65800)
    2006-09-22 02:50:24 UTC (rev 65801)
    @@ -1,3 +1,7 @@
    +2006-09-21 Gonzalo Paniagua Javier <gonzalo (AT) ximian (DOT) com>
    +
    +* FileInfo.cs: eol-style.
    +
    2006-09-19 Gert Driesen <drieseng (AT) users (DOT) sourceforge.net>
    * FileNotFoundException.cs: Changed message for default ctor to match
    Modified:
    2006-09-22 01:16:12 UTC (rev 65800)
    2006-09-22 02:50:24 UTC (rev 65801)
    @@ -1,14 +1,14 @@
    -//
    -//
    -// System.IFileInfo.cs
    -//
    -// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
    -//
    -// Author: Jim Richardson, develop (AT) wtfo-guru (DOT) com
    -// Dan Lewis (dihlewis (AT) yahoo (DOT) co.uk)
    -// Created: Monday, August 13, 2001
    -//
    -//
    +//
    +//
    +// System.IFileInfo.cs
    +//
    +// Copyright (C) 2001 Moonlight Enterprises, All Rights Reserved
    +//
    +// Author: Jim Richardson, develop (AT) wtfo-guru (DOT) com
    +// Dan Lewis (dihlewis (AT) yahoo (DOT) co.uk)
    +// Created: Monday, August 13, 2001
    +//
    +//
    //
    // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
    @@ -32,168 +32,168 @@
    // F CNTRACT, TRT R THERWISE, ARISING FRM, UT F R IN CNNECTIN
    // WITH THE SFTWARE R THE USE R THER DEALINGS IN THE SFTWARE.
    //
    -
    -using System;
    -
    -namespace System.I {
    -
    -[Serializable]
    -public sealed class FileInfo : FileSystemInfo {
    -
    -
    -private bool exists;
    -
    -public FileInfo (string path) {
    -CheckPath (path);
    -
    -Path = path;
    -FullPath = Path.GetFullPath (path);
    -}
    -
    -internal override void InternalRefresh ()
    -{
    -exists = File.Exists (FullPath);
    -}
    -
    -
    -// public properties
    -
    -public override bool Exists {
    -get {
    -Refresh (false);
    -
    -if (stat.Attributes == MonoIInvalidFileAttributes)
    -return false;
    -
    -if ((stat.Attributes & FileAttributes.Directory) != 0)
    -return false;
    -
    -return exists;
    -}
    -}
    -
    -public override string Name {
    -get {
    -return Path.GetFileName (FullPath);
    -}
    -}
    -
    -public long Length {
    -get {
    -if (!Exists)
    -throw new FileNotFoundException ("Could not find file \"" + Path + "\".", Path);
    -
    -return stat.Length;
    -}
    -}
    -
    -public string DirectoryName {
    -get {
    -return Path.GetDirectoryName (FullPath);
    -}
    -}
    -
    -public DirectoryInfo Directory {
    -get {
    -return new DirectoryInfo (DirectoryName);
    -}
    -}
    -
    -// streamreader methods
    -
    -public StreamReader Text () {
    -return new StreamReader ( (FileM, FileAccess.Read));
    -}
    -
    -public StreamWriter CreateText () {
    -return new StreamWriter ( (FileMode.Create, FileAccess.Write));
    -}
    -
    -public StreamWriter AppendText () {
    -return new StreamWriter ( (FileMode.Append, FileAccess.Write));
    -}
    -
    -// filestream methods
    -
    -public FileStream Create ()
    -{
    -return File.Create (FullPath);
    -}
    -
    -
    -public FileStream Read () {
    -return (FileM, FileAccess.Read, FileShare.Read);
    -}
    -
    -public FileStream Write () {
    -return (FileMCreate, FileAccess.Write);
    -}
    -
    -public FileStream (FileMode mode) {
    -return (mode, FileAccess.ReadWrite);
    -}
    -
    -public FileStream (FileMode mode, FileAccess access) {
    -return (mode, access, FileShare.None);
    -}
    -
    -public FileStream (FileMode mode, FileAccess access, FileShare share) {
    -return new FileStream (FullPath, mode, access, share);
    -}
    -
    -// file methods
    -
    -public override void Delete () {
    -MonoIError error;
    -
    -if (!MonoIExists (FullPath, out error)) {
    -// a weird MS.NET behaviour
    -return;
    -}
    -
    -if (MonoIExistsDirectory (FullPath, out error)) {
    -throw new UnauthorizedAccessException ("Access to the path \"" + FullPath + "\" is denied.");
    -}
    -
    -if (!MonoIDeleteFile (FullPath, out error)) {
    -throw MonoIGetException (Path,
    - error);
    -}
    -}
    -
    -public void MoveTo (string dest) {
    -
    -if (dest == null)
    -throw new ArgumentNullException ();
    -
    - if (dest == Name || dest == FullName)
    - return;
    -
    -MonoIError error;
    -if (MonoIExists (dest, out error) ||
    -MonoIExistsDirectory (dest, out error))
    -throw new IException ();
    -File.Move (FullPath, dest);
    -this.FullPath = Path.GetFullPath (dest);
    -}
    -
    -public FileInfo CopyTo (string path) {
    -return CopyTo (path, false);
    -}
    -
    -public FileInfo CopyTo (string path, bool overwrite) {
    -string dest = Path.GetFullPath (path);
    -
    -if (overwrite && File.Exists (path))
    -File.Delete (path);
    -
    -File.Copy (FullPath, dest);
    -
    -return new FileInfo (dest);
    -}
    -
    -public override string ToString () {
    -return Path;
    -}
    -}
    -}
    +
    +using System;
    +
    +namespace System.I {
    +
    +[Serializable]
    +public sealed class FileInfo : FileSystemInfo {
    +
    +
    +private bool exists;
    +
    +public FileInfo (string path) {
    +CheckPath (path);
    +
    +Path = path;
    +FullPath = Path.GetFullPath (path);
    +}
    +
    +internal override void InternalRefresh ()
    +{
    +exists = File.Exists (FullPath);
    +}
    +
    +
    +// public properties
    +
    +public override bool Exists {
    +get {
    +Refresh (false);
    +
    +if (stat.Attributes == MonoIInvalidFileAttributes)
    +return false;
    +
    +if ((stat.Attributes & FileAttributes.Directory) != 0)
    +return false;
    +
    +return exists;
    +}
    +}
    +
    +public override string Name {
    +get {
    +return Path.GetFileName (FullPath);
    +}
    +}
    +
    +public long Length {
    +get {
    +if (!Exists)
    +throw new FileNotFoundException ("Could not find file \"" + Path + "\".", Path);
    +
    +return stat.Length;
    +}
    +}
    +
    +public string DirectoryName {
    +get {
    +return Path.GetDirectoryName (FullPath);
    +}
    +}
    +
    +public DirectoryInfo Directory {
    +get {
    +return new DirectoryInfo (DirectoryName);
    +}
    +}
    +
    +// streamreader methods
    +
    +public StreamReader Text () {
    +return new StreamReader ( (FileM, FileAccess.Read));
    +}
    +
    +public StreamWriter CreateText () {
    +return new StreamWriter ( (FileMode.Create, FileAccess.Write));
    +}
    +
    +public StreamWriter AppendText () {
    +return new StreamWriter ( (FileMode.Append, FileAccess.Write));
    +}
    +
    +// filestream methods
    +
    +public FileStream Create ()
    +{
    +return File.Create (FullPath);
    +}
    +
    +
    +public FileStream Read () {
    +return (FileM, FileAccess.Read, FileShare.Read);
    +}
    +
    +public FileStream Write () {
    +return (FileMCreate, FileAccess.Write);
    +}
    +
    +public FileStream (FileMode mode) {
    +return (mode, FileAccess.ReadWrite);
    +}
    +
    +public FileStream (FileMode mode, FileAccess access) {
    +return (mode, access, FileShare.None);
    +}
    +
    +public FileStream (FileMode mode, FileAccess access, FileShare share) {
    +return new FileStream (FullPath, mode, access, share);
    +}
    +
    +// file methods
    +
    +public override void Delete () {
    +MonoIError error;
    +
    +if (!MonoIExists (FullPath, out error)) {
    +// a weird MS.NET behaviour
    +return;
    +}
    +
    +if (MonoIExistsDirectory (FullPath, out error)) {
    +throw new UnauthorizedAccessException ("Access to the path \"" + FullPath + "\" is denied.");
    +}
    +
    +if (!MonoIDeleteFile (FullPath, out error)) {
    +throw MonoIGetException (Path,
    + error);
    +}
    +}
    +
    +public void MoveTo (string dest) {
    +
    +if (dest == null)
    +throw new ArgumentNullException ();
    +
    + if (dest == Name || dest == FullName)
    + return;
    +
    +MonoIError error;
    +if (MonoIExists (dest, out error) ||
    +MonoIExistsDirectory (dest, out error))
    +throw new IException ();
    +File.Move (FullPath, dest);
    +this.FullPath = Path.GetFullPath (dest);
    +}
    +
    +public FileInfo CopyTo (string path) {
    +return CopyTo (path, false);
    +}
    +
    +public FileInfo CopyTo (string path, bool overwrite) {
    +string dest = Path.GetFullPath (path);
    +
    +if (overwrite && File.Exists (path))
    +File.Delete (path);
    +
    +File.Copy (FullPath, dest);
    +
    +return new FileInfo (dest);
    +}
    +
    +public override string ToString () {
    +return Path;
    +}
    +}
    +}
    Property changes on:
    Name: svn:eol-style
    + native
    Mono-patches maillist - Mono-patches (AT) lists (DOT) ximian.com

Re: r65801 - trunk/mcs/class/corlib/System.IO


max 4000 letters.
Your nickname that display:
In order to stop the spam: 2 + 1 =
QUESTION ON "Development"

EMSDN.COM