Exemplo n.º 1
0
 // internal
 private void init()
 {
     MyDirectory   = new Dictionary <string, Chunk>();
     MySubDirs     = new Dictionary <string, List <Chunk> >();
     orderedChunks = new List <Chunk>();
     MySubDirs.Add(ROOT_PATH, orderedChunks);
     openChunks = new Dictionary <ulong, OpenChunk>();
     Stats      = new CFSStats();
     KeepStats  = false;
 }
Exemplo n.º 2
0
 public CFSStats snapshot()
 {
     lock (myLock)
     {
         CFSStats rv = new CFSStats();
         rv.OtherCalls       = this.OtherCalls;
         rv.ReadBytes        = this.ReadBytes;
         rv.ReadCalls        = this.ReadCalls;
         rv.UnsupportedCalls = this.UnsupportedCalls;
         rv.Starting         = DateTime.Now;
         return(rv);
     }
 }
Exemplo n.º 3
0
        // runs itself.  for a GUI program this needs to be invoked on a thread
        // other than the gui's main one!
        public bool exec()
        {
            Stats = new CFSStats();
            DokanOptions opt = new DokanOptions();

            opt.MountPoint     = Config.MountPoint;
            opt.DebugMode      = Logger.UsuallyDebugging && Logger.getLogger().isConsole();
            opt.UseStdErr      = Logger.UsuallyDebugging && Logger.getLogger().isConsole();
            opt.VolumeLabel    = "ChunkFS-" + Config.Name;
            opt.FileSystemName = "CFS";
            int status = DokanNet.DokanMain(opt, this);

            switch (status)
            {
            case DokanNet.DOKAN_DRIVE_LETTER_ERROR:
                Logger.getLogger().log("Drive letter error");
                break;

            case DokanNet.DOKAN_DRIVER_INSTALL_ERROR:
                Logger.getLogger().log("Driver install error");
                break;

            case DokanNet.DOKAN_MOUNT_ERROR:
                Logger.getLogger().log("Mount error");
                break;

            case DokanNet.DOKAN_START_ERROR:
                Logger.getLogger().log("Start error");
                break;

            case DokanNet.DOKAN_ERROR:
                Logger.getLogger().log("Unknown error");
                break;

            case DokanNet.DOKAN_SUCCESS:
                Logger.getLogger().log("Success");
                break;

            default:
                Logger.getLogger().log("Unknown status: " + status);
                break;
            }
            return(true);
        }
Exemplo n.º 4
0
 public CFSStats snapshot()
 {
     lock (myLock)
     {
         CFSStats rv = new CFSStats();
         rv.OtherCalls = this.OtherCalls;
         rv.ReadBytes = this.ReadBytes;
         rv.ReadCalls = this.ReadCalls;
         rv.UnsupportedCalls = this.UnsupportedCalls;
         rv.Starting = DateTime.Now;
         return rv;
     }
 }
Exemplo n.º 5
0
 // internal
 private void init()
 {
     MyDirectory = new Dictionary<string, Chunk>();
     MySubDirs = new Dictionary<string, List<Chunk>>();
     orderedChunks = new List<Chunk>();
     MySubDirs.Add(ROOT_PATH, orderedChunks);
     openChunks = new Dictionary<ulong, OpenChunk>();
     Stats = new CFSStats();
     KeepStats = false;
 }
Exemplo n.º 6
0
 // runs itself.  for a GUI program this needs to be invoked on a thread
 // other than the gui's main one!
 public bool exec()
 {
     Stats = new CFSStats();
     DokanOptions opt = new DokanOptions();
     opt.MountPoint = Config.MountPoint;
     opt.DebugMode = Logger.UsuallyDebugging && Logger.getLogger().isConsole();
     opt.UseStdErr = Logger.UsuallyDebugging && Logger.getLogger().isConsole();
     opt.VolumeLabel = "ChunkFS-"+Config.Name;
     opt.FileSystemName = "CFS";
     int status = DokanNet.DokanMain(opt, this);
     switch (status)
     {
         case DokanNet.DOKAN_DRIVE_LETTER_ERROR:
             Logger.getLogger().log("Drive letter error");
             break;
         case DokanNet.DOKAN_DRIVER_INSTALL_ERROR:
             Logger.getLogger().log("Driver install error");
             break;
         case DokanNet.DOKAN_MOUNT_ERROR:
             Logger.getLogger().log("Mount error");
             break;
         case DokanNet.DOKAN_START_ERROR:
             Logger.getLogger().log("Start error");
             break;
         case DokanNet.DOKAN_ERROR:
             Logger.getLogger().log("Unknown error");
             break;
         case DokanNet.DOKAN_SUCCESS:
             Logger.getLogger().log("Success");
             break;
         default:
             Logger.getLogger().log("Unknown status: " + status);
             break;
     }
     return true;
 }