using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace System.IO
{
/// Provides the base class for both and objects.
/// 2
// Token: 0x020001BD RID: 445
[ComVisible(true)]
[Serializable]
public abstract class FileSystemInfo : MarshalByRefObject, ISerializable
{
/// Initializes a new instance of the class.
// Token: 0x060016D6 RID: 5846 RVA: 0x00058390 File Offset: 0x00056590
protected FileSystemInfo()
{
this.valid = false;
this.FullPath = null;
}
/// 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.
/// The specified is null.
// Token: 0x060016D7 RID: 5847 RVA: 0x000583A8 File Offset: 0x000565A8
protected FileSystemInfo(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException("info");
}
this.FullPath = info.GetString("FullPath");
this.OriginalPath = info.GetString("OriginalPath");
}
/// 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.
/// 2
///
///
///
///
// Token: 0x060016D8 RID: 5848 RVA: 0x000583E4 File Offset: 0x000565E4
[ComVisible(false)]
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
info.AddValue("OriginalPath", this.OriginalPath, typeof(string));
info.AddValue("FullPath", this.FullPath, typeof(string));
}
/// Gets a value indicating whether the file or directory exists.
/// true if the file or directory exists; otherwise, false.
/// 1
// Token: 0x17000407 RID: 1031
// (get) Token: 0x060016D9 RID: 5849
public abstract bool Exists { get; }
/// 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.
/// A string that is the name of the parent directory, the name of the last directory in the hierarchy, or the name of a file, including the file name extension.
/// 1
// Token: 0x17000408 RID: 1032
// (get) Token: 0x060016DA RID: 5850
public abstract string Name { get; }
/// Gets the full path of the directory or file.
/// A string containing the full path.
/// The fully qualified path and file name is 260 or more characters.
/// The caller does not have the required permission.
/// 1
///
///
///
// Token: 0x17000409 RID: 1033
// (get) Token: 0x060016DB RID: 5851 RVA: 0x00058428 File Offset: 0x00056628
public virtual string FullName
{
get
{
return this.FullPath;
}
}
/// Gets the string representing the extension part of the file.
/// A string containing the extension.
/// 1
// Token: 0x1700040A RID: 1034
// (get) Token: 0x060016DC RID: 5852 RVA: 0x00058430 File Offset: 0x00056630
public string Extension
{
get
{
return Path.GetExtension(this.Name);
}
}
/// Gets or sets the current directory or file.
///
/// of the current .
/// The specified file does not exist.
/// The specified path is invalid, such as being on an unmapped drive.
/// The caller does not have the required permission.
/// The caller attempts to set an invalid file attribute.
///
/// cannot initialize the data.
/// 1
///
///
///
// Token: 0x1700040B RID: 1035
// (get) Token: 0x060016DD RID: 5853 RVA: 0x00058440 File Offset: 0x00056640
// (set) Token: 0x060016DE RID: 5854 RVA: 0x00058454 File Offset: 0x00056654
public FileAttributes Attributes
{
get
{
this.Refresh(false);
return this.stat.Attributes;
}
set
{
MonoIOError monoIOError;
if (!MonoIO.SetFileAttributes(this.FullName, value, out monoIOError))
{
throw MonoIO.GetException(this.FullName, monoIOError);
}
this.Refresh(true);
}
}
/// Gets or sets the creation time of the current directory or file.
/// The creation date and time of the current object.
///
/// cannot initialize the data.
/// The specified path is invalid, such as being on an unmapped drive.
/// The current operating system is not Microsoft Windows NT or later.
/// 1
///
///
///
// Token: 0x1700040C RID: 1036
// (get) Token: 0x060016DF RID: 5855 RVA: 0x00058488 File Offset: 0x00056688
// (set) Token: 0x060016E0 RID: 5856 RVA: 0x000584A4 File Offset: 0x000566A4
public DateTime CreationTime
{
get
{
this.Refresh(false);
return DateTime.FromFileTime(this.stat.CreationTime);
}
set
{
long num = value.ToFileTime();
MonoIOError monoIOError;
if (!MonoIO.SetFileTime(this.FullName, num, -1L, -1L, out monoIOError))
{
throw MonoIO.GetException(this.FullName, monoIOError);
}
this.Refresh(true);
}
}
/// Gets or sets the creation time, in coordinated universal time (UTC), of the current directory or file.
/// The creation date and time in UTC format of the current object.
///
/// cannot initialize the data.
/// The specified path is invalid, such as being on an unmapped drive.
/// The current operating system is not Microsoft Windows NT or later.
/// 1
///
///
///
// Token: 0x1700040D RID: 1037
// (get) Token: 0x060016E1 RID: 5857 RVA: 0x000584E4 File Offset: 0x000566E4
// (set) Token: 0x060016E2 RID: 5858 RVA: 0x00058500 File Offset: 0x00056700
[ComVisible(false)]
public DateTime CreationTimeUtc
{
get
{
return this.CreationTime.ToUniversalTime();
}
set
{
this.CreationTime = value.ToLocalTime();
}
}
/// Gets or sets the time the current file or directory was last accessed.
/// The time that the current file or directory was last accessed.
///
/// cannot initialize the data.
/// The current operating system is not Microsoft Windows NT or later.
/// 1
///
///
///
// Token: 0x1700040E RID: 1038
// (get) Token: 0x060016E3 RID: 5859 RVA: 0x00058510 File Offset: 0x00056710
// (set) Token: 0x060016E4 RID: 5860 RVA: 0x0005852C File Offset: 0x0005672C
public DateTime LastAccessTime
{
get
{
this.Refresh(false);
return DateTime.FromFileTime(this.stat.LastAccessTime);
}
set
{
long num = value.ToFileTime();
MonoIOError monoIOError;
if (!MonoIO.SetFileTime(this.FullName, -1L, num, -1L, out monoIOError))
{
throw MonoIO.GetException(this.FullName, monoIOError);
}
this.Refresh(true);
}
}
/// Gets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed.
/// The UTC time that the current file or directory was last accessed.
///
/// cannot initialize the data.
/// The current operating system is not Microsoft Windows NT or later.
/// 1
///
///
///
// Token: 0x1700040F RID: 1039
// (get) Token: 0x060016E5 RID: 5861 RVA: 0x0005856C File Offset: 0x0005676C
// (set) Token: 0x060016E6 RID: 5862 RVA: 0x00058590 File Offset: 0x00056790
[ComVisible(false)]
public DateTime LastAccessTimeUtc
{
get
{
this.Refresh(false);
return this.LastAccessTime.ToUniversalTime();
}
set
{
this.LastAccessTime = value.ToLocalTime();
}
}
/// Gets or sets the time when the current file or directory was last written to.
/// The time the current file was last written.
///
/// cannot initialize the data.
/// The current operating system is not Microsoft Windows NT or later.
/// 1
///
///
///
// Token: 0x17000410 RID: 1040
// (get) Token: 0x060016E7 RID: 5863 RVA: 0x000585A0 File Offset: 0x000567A0
// (set) Token: 0x060016E8 RID: 5864 RVA: 0x000585BC File Offset: 0x000567BC
public DateTime LastWriteTime
{
get
{
this.Refresh(false);
return DateTime.FromFileTime(this.stat.LastWriteTime);
}
set
{
long num = value.ToFileTime();
MonoIOError monoIOError;
if (!MonoIO.SetFileTime(this.FullName, -1L, -1L, num, out monoIOError))
{
throw MonoIO.GetException(this.FullName, monoIOError);
}
this.Refresh(true);
}
}
/// Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to.
/// The UTC time when the current file was last written to.
///
/// cannot initialize the data.
/// The current operating system is not Microsoft Windows NT or later.
/// 1
///
///
///
// Token: 0x17000411 RID: 1041
// (get) Token: 0x060016E9 RID: 5865 RVA: 0x000585FC File Offset: 0x000567FC
// (set) Token: 0x060016EA RID: 5866 RVA: 0x00058620 File Offset: 0x00056820
[ComVisible(false)]
public DateTime LastWriteTimeUtc
{
get
{
this.Refresh(false);
return this.LastWriteTime.ToUniversalTime();
}
set
{
this.LastWriteTime = value.ToLocalTime();
}
}
/// Deletes a file or directory.
/// The specified path is invalid; for example, it is on an unmapped drive.
/// 2
// Token: 0x060016EB RID: 5867
public abstract void Delete();
/// Refreshes the state of the object.
/// A device such as a disk drive is not ready.
/// 1
// Token: 0x060016EC RID: 5868 RVA: 0x00058630 File Offset: 0x00056830
public void Refresh()
{
this.Refresh(true);
}
// Token: 0x060016ED RID: 5869 RVA: 0x0005863C File Offset: 0x0005683C
internal void Refresh(bool force)
{
if (this.valid && !force)
{
return;
}
MonoIOError monoIOError;
MonoIO.GetFileStat(this.FullName, out this.stat, out monoIOError);
this.valid = true;
this.InternalRefresh();
}
// Token: 0x060016EE RID: 5870 RVA: 0x0005867C File Offset: 0x0005687C
internal virtual void InternalRefresh()
{
}
// Token: 0x060016EF RID: 5871 RVA: 0x00058680 File Offset: 0x00056880
internal void CheckPath(string path)
{
if (path == null)
{
throw new ArgumentNullException("path");
}
if (path.Length == 0)
{
throw new ArgumentException("An empty file name is not valid.");
}
if (path.IndexOfAny(Path.InvalidPathChars) != -1)
{
throw new ArgumentException("Illegal characters in path.");
}
}
/// Represents the fully qualified path of the directory or file.
/// The fully qualified path is 260 or more characters.
// Token: 0x040006A9 RID: 1705
protected string FullPath;
/// The path originally specified by the user, whether relative or absolute.
// Token: 0x040006AA RID: 1706
protected string OriginalPath;
// Token: 0x040006AB RID: 1707
internal MonoIOStat stat;
// Token: 0x040006AC RID: 1708
internal bool valid;
}
}