112 lines
3.1 KiB
C#
112 lines
3.1 KiB
C#
// Decompiled with JetBrains decompiler
|
|
// Type: Rei.Fs.IO.FileInfo
|
|
// Assembly: Rei.Fs, Version=1.13.2.8796, Culture=neutral, PublicKeyToken=null
|
|
// MVID: D8B08A8B-697C-4439-9CFF-1BE4EE46F7B0
|
|
// Assembly location: F:\Eigene Dateien\Dropbox\portable Collection\Progs\CarotDAV\Rei.Fs.dll
|
|
|
|
using System;
|
|
using System.IO;
|
|
|
|
namespace Rei.Fs.IO
|
|
{
|
|
public class FileInfo
|
|
{
|
|
private FileAttributes pFileAttributes;
|
|
private DateTime pCreationTime;
|
|
private DateTime pLastAccessTime;
|
|
private DateTime pLastWriteTime;
|
|
private ulong pFileSize;
|
|
private string pFileName;
|
|
private string pFullPath;
|
|
private string pAltFileName;
|
|
|
|
internal FileInfo(string path, Win32Native.WIN32_FIND_DATA d)
|
|
{
|
|
this.pFileAttributes = d.dwFileAttributes;
|
|
this.pCreationTime = DateTime.FromFileTime((long) d.ftCreationTime.dwHighDateTime << 32 | (long) d.ftCreationTime.dwLowDateTime & (long) uint.MaxValue);
|
|
this.pLastAccessTime = DateTime.FromFileTime((long) d.ftLastAccessTime.dwHighDateTime << 32 | (long) d.ftLastAccessTime.dwLowDateTime & (long) uint.MaxValue);
|
|
this.pLastWriteTime = DateTime.FromFileTime((long) d.ftLastWriteTime.dwHighDateTime << 32 | (long) d.ftLastWriteTime.dwLowDateTime & (long) uint.MaxValue);
|
|
this.pFileSize = checked (((ulong) d.nFileSizeHigh << 32) + (ulong) d.nFileSizeLow);
|
|
this.pFileName = d.cFileName;
|
|
this.pAltFileName = d.cAlternateFileName;
|
|
this.pFullPath = path;
|
|
}
|
|
|
|
internal FileInfo(string path, Win32Native.WIN32_FILE_ATTRIBUTE_DATA d)
|
|
{
|
|
this.pFileAttributes = d.dwFileAttributes;
|
|
this.pCreationTime = DateTime.FromFileTime((long) d.ftCreationTime.dwHighDateTime << 32 | (long) d.ftCreationTime.dwLowDateTime & (long) uint.MaxValue);
|
|
this.pLastAccessTime = DateTime.FromFileTime((long) d.ftLastAccessTime.dwHighDateTime << 32 | (long) d.ftLastAccessTime.dwLowDateTime & (long) uint.MaxValue);
|
|
this.pLastWriteTime = DateTime.FromFileTime((long) d.ftLastWriteTime.dwHighDateTime << 32 | (long) d.ftLastWriteTime.dwLowDateTime & (long) uint.MaxValue);
|
|
this.pFileSize = checked (((ulong) d.nFileSizeHigh << 32) + (ulong) d.nFileSizeLow);
|
|
this.pFileName = FileSystem.GetFilename(path);
|
|
this.pAltFileName = (string) null;
|
|
this.pFullPath = path;
|
|
}
|
|
|
|
public bool IsDirectory
|
|
{
|
|
get
|
|
{
|
|
return (this.FileAttributes & FileAttributes.Directory) != (FileAttributes) 0;
|
|
}
|
|
}
|
|
|
|
public FileAttributes FileAttributes
|
|
{
|
|
get
|
|
{
|
|
return this.pFileAttributes;
|
|
}
|
|
}
|
|
|
|
public DateTime CreationTime
|
|
{
|
|
get
|
|
{
|
|
return this.pCreationTime;
|
|
}
|
|
}
|
|
|
|
public DateTime LastAccessTime
|
|
{
|
|
get
|
|
{
|
|
return this.pLastAccessTime;
|
|
}
|
|
}
|
|
|
|
public DateTime LastWriteTime
|
|
{
|
|
get
|
|
{
|
|
return this.pLastWriteTime;
|
|
}
|
|
}
|
|
|
|
public ulong FileSize
|
|
{
|
|
get
|
|
{
|
|
return this.pFileSize;
|
|
}
|
|
}
|
|
|
|
public string FileName
|
|
{
|
|
get
|
|
{
|
|
return this.pFileName;
|
|
}
|
|
}
|
|
|
|
public string FullPath
|
|
{
|
|
get
|
|
{
|
|
return this.pFullPath;
|
|
}
|
|
}
|
|
}
|
|
}
|