Пример #1
0
        public int FindFiles(String filename, ArrayList files, DokanFileInfo info)
        {
            MemFsEntry entry = GetEntryForPath(filename);

            if (!(entry is MemFSDirectory))
            {
                return(-DokanNet.ERROR_FILE_NOT_FOUND);
            }

            FileInformation dots = entry.GetFileInfo();

            dots.FileName = ".";
            files.Add(dots);

            if (entry == root)
            {
                dots          = entry.GetFileInfo();
                dots.FileName = "..";
                files.Add(dots);
            }
            else
            {
                dots          = GetDirectoryForPath(filename).GetFileInfo();
                dots.FileName = "..";
                files.Add(dots);
            }

            foreach (MemFsEntry e in ((MemFSDirectory)entry).GetEntries())
            {
                files.Add(e.GetFileInfo());
            }

            return(0);
        }
Пример #2
0
        public int GetFileInformation(String filename, FileInformation fileinfo, DokanFileInfo info)
        {
            MemFsEntry entry = GetEntryForPath(filename);

            if (entry == null)
            {
                return(-DokanNet.ERROR_FILE_NOT_FOUND);
            }

            FileInformation f = entry.GetFileInfo();

            fileinfo.Attributes     = f.Attributes;
            fileinfo.CreationTime   = f.CreationTime;
            fileinfo.LastAccessTime = f.LastAccessTime;
            fileinfo.LastWriteTime  = f.LastWriteTime;
            fileinfo.Length         = f.Length;
            fileinfo.FileName       = f.FileName;

            return(0);
        }