예제 #1
0
 public FileBasicInformation(byte[] buffer, int offset)
 {
     CreationTime   = FileTimeHelper.ReadSetFileTime(buffer, offset + 0);
     LastAccessTime = FileTimeHelper.ReadSetFileTime(buffer, offset + 8);
     LastWriteTime  = FileTimeHelper.ReadSetFileTime(buffer, offset + 16);
     ChangeTime     = FileTimeHelper.ReadSetFileTime(buffer, offset + 24);
     FileAttributes = (FileAttributes)LittleEndianConverter.ToUInt32(buffer, offset + 32);
     Reserved       = LittleEndianConverter.ToUInt32(buffer, offset + 36);
 }
예제 #2
0
        /// <summary>
        /// When setting file attributes, a value of -1 indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle.
        /// </summary>
        public static SetFileTime ReadSetFileTime(byte[] buffer, int offset)
        {
            long span = LittleEndianConverter.ToInt64(buffer, offset);

            return(SetFileTime.FromFileTimeUtc(span));
        }
예제 #3
0
        /// <summary>
        /// When setting file attributes, a value of -1 indicates to the server that it MUST NOT change this attribute for all subsequent operations on the same file handle.
        /// </summary>
        public static void WriteSetFileTime(byte[] buffer, int offset, SetFileTime time)
        {
            long span = time.ToFileTimeUtc();

            LittleEndianWriter.WriteInt64(buffer, offset, span);
        }