protected FileSystemData(string path, WIN32_FIND_DATA raw) {

			_raw = raw;
			_path = path;
			_creationDateTimeUtc = DateTimeExt.FromFileTimeUtc(_raw.ftCreationTime);
			_lastAccessTimeUtc = DateTimeExt.FromFileTimeUtc(_raw.ftLastAccessTime);
			_lastWriteTimeUtc = DateTimeExt.FromFileTimeUtc(_raw.ftLastWriteTime);
        }
Exemple #2
0
		long CalculateFileSize(WIN32_FIND_DATA data) => CalculateFileSize(data.nFileSizeLow, data.nFileSizeHigh);
Exemple #3
0
		public FileData(string path, WIN32_FIND_DATA data) : base(path, data) {

			Size = CalculateFileSize(data);
		}
		public DirectoryDataSnapshot(string path, WIN32_FIND_DATA data) : base(path, data) {
		}
Exemple #5
0
		internal static extern bool FindNextFile(IntPtr hFindFile, out WIN32_FIND_DATA lpFindFileData);
Exemple #6
0
		internal static extern IntPtr FindFirstFile(string lpFileName, out WIN32_FIND_DATA lpFindFileData);
		/// <summary>
		/// Returns the correct Data Type for the item, either FileData or DirectoryData
		/// </summary>
		FileSystemData GenerateFileSystemReturnData(string path, WIN32_FIND_DATA data) {

			if (data.dwFileAttributes.IsDirectory()) {

				// This double checks we have a real directory
				if (data.cFileName != "." && data.cFileName != "..") {

					return new DirectoryData(path, data);
				}

				return null;
			}
			else {

				return new FileData(path, data);
			}
		}