Exemplo n.º 1
0
        /// <summary>
        /// Compares the specified data.
        /// </summary>
        /// <param name="data">The data.</param>
        /// <param name="offset">The offset.</param>
        /// <param name="type">The type.</param>
        /// <returns></returns>
        public bool Compare(byte[] data, uint offset, FatType type)
        {
            BinaryFormat entry = new BinaryFormat(data);

            byte first = entry.GetByte(offset + Entry.DOSName);

            if (first == FileNameAttribute.LastEntry)
            {
                return(false);
            }

            if ((first == FileNameAttribute.Deleted) | (first == FileNameAttribute.Dot))
            {
                return(false);
            }

            if (first == FileNameAttribute.Escape)
            {
                return(false);
            }

            string entryname = FatFileSystem.ExtractFileName(data, offset);

            if (entryname == name)
            {
                return(true);
            }

            return(false);
        }