mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.MarshalByRefObject System.Runtime.Serialization.ISerializable System.Runtime.InteropServices.ComVisible(true)

The class contains methods that are common to file and directory manipulation. A object can represent either a file or a directory, thus serving as the basis for or objects. Use this base class when parsing a lot of files and directories.

A derived class can inherit from only if the derived class has the AllAccess permission from the enumeration.

In members that accept a path, the path can refer to a file or just a directory. The specified path can also refer to a relative path or a Universal Naming Convention (UNC) path for a server and share name. For example, all the following are acceptable paths:

"c:\\MyDir\\MyFile.txt" in C#, or "c:\MyDir\MyFile.txt" in Visual Basic.

"c:\\MyDir" in C#, or "c:\MyDir" in Visual Basic.

"MyDir\\MySubdir" in C#, or "MyDir\MySubDir" in Visual Basic.

"\\\\MyServer\\MyShare" in C#, or "\\MyServer\MyShare" in Visual Basic.

For a list of common I/O tasks, see Common I/O Tasks.

Provides the base class for both and objects.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  For a list of common I/O tasks, see Common I/O Tasks.

  Initializes a new instance of the class.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  For a list of common I/O tasks, see Common I/O Tasks.

  Initializes a new instance of the class with serialized data.

  The that holds the serialized object data about the exception being thrown.
  The that contains contextual information about the source or destination.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.IO.FileAttributes To be added: an object of type 'FileAttributes'

  The value of the property is pre-cached if the current instance of the object was returned from any of the following methods:

  To get the latest value, call the method.

  The value of this property is a combination of the archive, compressed, directory, hidden, offline, read-only, system, and temporary file attribute flags.

  When you set this value, use the bitwise OR operator (| in C# or Or in Visual Basic) to apply more than one value. To retain any existing values in the property, include the value of the property in your assignment. For example:

  exampleFile.Attributes = exampleFile.Attributes | FileAttributes.ReadOnly;

  Gets or sets the attributes for the current file or directory.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime To be added: an object of type 'DateTime'

  Note This method may return an inaccurate value, because it uses native functions whose values may not be continuously updated by the operating system.

  The value of the property is pre-cached if the current instance of the object was returned from any of the following methods:

  To get the latest value, call the method.

  If the file described in the object does not exist, this property will return 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.

  NTFS-formatted drives may cache file meta-info, such as file creation time, for a short period of time. This process is known as file tunneling. As a result, it may be necessary to explicitly set the creation time of a file if you are overwriting or replacing an existing file.

  This property value is null if the file system containing the object does not support this information.

  Gets or sets the creation time of the current file or directory.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.DateTime To be added.

  Note This method may return an inaccurate value, because it uses native functions whose values may not be continuously updated by the operating system.

  The value of the property is pre-cached if the current instance of the object was returned from any of the following methods:

  To get the latest value, call the method.

  If the file described in the object does not exist, this property will return 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC).

  NTFS-formatted drives may cache file meta-info, such as file creation time, for a short period of time. This process is known as file tunneling. As a result, it may be necessary to explicitly set the creation time of a file if you are overwriting or replacing an existing file.

  This property value is null if the file system containing the object does not support this information.

  Gets or sets the creation time, in coordinated universal time (UTC), of the current file or directory.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void To be added

  Deletes a file or directory.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added: an object of type 'bool'

  For a list of common I/O tasks, see Common I/O Tasks.

  Gets a value indicating whether the file or directory exists.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added: an object of type 'string'

  The Extension property returns the extension, including the period (.). For example, for a file c:\NewFile.txt, this property returns ".txt".

  The following table lists examples of other typical or related I/O tasks.

  To do this...

  See the example in this topic...

  Create a text file.

  [<topic://cpconwritingtexttofile>]

  Write to a text file.

  [<topic://cpconwritingtexttofile>]

  Read from a text file.

  [<topic://cpconreadingtextfromfile>]

  Retrieve the fully qualified path of a file.

  Retrieve only the file name a path.

  Retrieve only the directory name from a path.

  Change the extension of a file.

  Gets the string representing the extension part of the file.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added: an object of type 'string'

  For example, for a file c:\NewFile.txt, this property returns "c:\NewFile.txt".

  For a list of common I/O tasks, see Common I/O Tasks.

  Gets the full path of the directory or file.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added

  Represents the fully qualified path of the directory or file.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Void `` ``

  For a list of common I/O tasks, see Common I/O Tasks.

  Sets the object with the file name and additional exception information.

  The that holds the serialized object data about the exception being thrown. The that contains contextual information about the source or destination.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime To be added: an object of type 'DateTime'

  Note This method may return an inaccurate value, because it uses native functions whose values may not be continuously updated by the operating system.

  If the file described in the object does not exist, this property will return 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.

  The value of the property is pre-cached if the current instance of the object was returned from any of the following methods:

  To get the latest value, call the method.

  Gets or sets the time the current file or directory was last accessed.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.DateTime To be added.

  Note This method may return an inaccurate value, because it uses native functions whose values may not be continuously updated by the operating system.

  The value of the property is pre-cached if the current instance of the object was returned from any of the following methods:

  To get the latest value, call the method.

  If the file described in the object does not exist, this property will return 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC).

  For a list of common I/O tasks, see Common I/O Tasks.

  Gets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.DateTime To be added: an object of type 'DateTime'

  Note This method may return an inaccurate value, because it uses native functions whose values may not be continuously updated by the operating system.

  The value of the property is pre-cached if the current instance of the object was returned from any of the following methods:

  To get the latest value, call the method.

  If the file described in the object does not exist, this property will return 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC), adjusted to local time.

  This property value is null if the file system containing the file does not support this information.

  Gets or sets the time when the current file or directory was last written to.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.DateTime To be added.

  Note This method may return an inaccurate value, because it uses native functions whose values may not be continuously updated by the operating system.

  The value of the property is pre-cached if the current instance of the object was returned from any of the following methods:

  To get the latest value, call the method.

  If the file described in the object does not exist, this property will return 12:00 midnight, January 1, 1601 A.D. (C.E.) Coordinated Universal Time (UTC).

  This property value is null if the file system containing the file does not support this information.

  Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added: an object of type 'string'

  For a directory, Name returns only the name of the parent directory, such as Dir, not c:\Dir. For a subdirectory, Name returns only the name of the subdirectory, such as Sub1, not c:\Dir\Sub1.

  For a file, Name returns only the file name and file name extension, such as MyFile.txt, not c:\Dir\Myfile.txt.

  For files, gets the name of the file. For directories, gets the name of the last directory in the hierarchy if a hierarchy exists. Otherwise, the Name property gets the name of the directory.

- Field
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String

  For a list of common I/O tasks, see Common I/O Tasks.

  The path originally specified by the user, whether relative or absolute.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  FileSystemInfo.Refresh takes a snapshot of the file from the current file system. Refresh cannot correct the underlying file system even if the file system returns incorrect or outdated information. This can happen on platforms such as Windows 98.

  Calls must be made to Refresh before attempting to get the attribute information, or the information will be outdated.

  Refreshes the state of the object.