Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine(args[0]);
            String CD = Directory.GetCurrentDirectory();

            String[] fs = args[0].Split(';');
            foreach (string dir in fs)
            {
                FS       tln = new FS();
                string[] d   = dir.Split('=');
                tln.TLD = Path.Combine(CD, d[0]);
                if (d.Length == 2)
                {
                    tln.P = fromstr(d[1]);
                }
                else
                {
                    tln.P = RWPerm.RO;
                }
                Console.WriteLine(tln.P.ToString());
                lfs.Add(tln);
            }
            WinUnion     wu  = new WinUnion(lfs);
            DokanOptions opt = DokanOptions.DebugMode;

            Dokan.Mount(wu, args[1], opt, new NullLogger());
        }
Exemplo n.º 2
0
 public static void Mount(MountableFileSystem fs)
 {
     if (CanMount())
     {
         char   drive  = GetAvailableDriveLetter();
         Thread thread = new Thread(new ThreadStart(() =>
         {
             DokanOptions options = DokanOptions.RemovableDrive;
             if (fs.Mode != OpenMode.ReadWrite)
             {
                 options |= DokanOptions.WriteProtection;
             }
             Dokan.Mount(fs, $"{drive}:", options);
         }
                                                    ));
         if (Mounted.ContainsKey(fs))
         {
             Unmount(fs);
         }
         thread.Start();
         Mounted[fs] = new Tuple <Thread, char>(thread, drive);
     }
     else
     {
         MessageBox.Show("Dokan driver seems to be missing. Install the driver and try again.");
     }
 }
Exemplo n.º 3
0
        public void Mount(string drive, string apiUrl, bool debugging)
        {
            if (apiUrl != null && apiUrl.Length > 0)
            {
                IpfsClient.DefaultApiUri = new Uri(apiUrl);
            }

            // Verify that the local IPFS service is up and running
            var x = new IpfsClient().IdAsync().Result;

            // CTRL-C will dismount and then exit.
            Console.CancelKeyPress += (s, e) =>
            {
                Console.WriteLine("shutting down...");
                Unmount(drive);
                e.Cancel = true;
            };

            // Mount IPFS, doesn't return until the drive is dismounted
            var options = DokanOptions.WriteProtection;

            if (debugging)
            {
                options |= DokanOptions.DebugMode;
            }
            Dokan.Mount(new IpfsDokan(), drive, options, new DokanLogger());
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("Memory Cached File System (MCFS). Copyright (C) acdra1n 2020.\n");
            Console.ResetColor();

            Dokan.Mount(new MCFSDrv(new MCFSParams()
            {
                TargetDataLocation = Environment.CurrentDirectory + "\\fsroot",
                VolumeLabel        = "mcfstest",
                Logger             = new Logging.ConsoleLogger()
            }), "K:\\", DokanOptions.FixedDrive, 5, new Logger((a, b) => { }, (a, b) => { }, (a, b) => { }, (a, b) => { }, (a, b) => { }));
        }
Exemplo n.º 5
0
        public void Mount(String device, String path) //, DokanNet.DokanOptions d, int number)
        {
            /*
             * DokanOptions dokanOptions = new DokanOptions();
             * dokanOptions.DebugMode = DebugMode;
             * dokanOptions.NetworkDrive = DiskOrFolder;
             * dokanOptions.MountPoint = MountPoint;
             * dokanOptions.UseKeepAlive = true;
             * dokanOptions.UseAltStream = true;
             * dokanOptions.VolumeLabel = strDriveLabel;
             * dokanOptions.ThreadCount = 1;
             */

            nfsClient.MountDevice(device);
            Dokan.Mount(this, path, DokanOptions.FixedDrive | DokanOptions.DebugMode, 1);
        }
Exemplo n.º 6
0
 public static void Mount(MountableFileSystem fs)
 {
     if (CanMount())
     {
         char   drive  = GetAvailableDriveLetter();
         Thread thread = new Thread(new ThreadStart(() =>
         {
             Dokan.Mount(fs, $"{drive}:", DokanOptions.RemovableDrive | DokanOptions.WriteProtection);
             Mounted.Remove(fs);
         }
                                                    ));
         if (Mounted.ContainsKey(fs))
         {
             Unmount(fs);
         }
         thread.Start();
         Mounted[fs] = new Tuple <Thread, char>(thread, drive);
     }
 }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.Cyan;
            Console.WriteLine(@"    __  _______ _________________
   / / / / ___// ____/ ____/ ___/
  / /_/ /\__ \/ /   / /_   \__ \ 
 / __  /___/ / /___/ __/  ___/ / 
/_/ /_//____/\____/_/    /____/  
                                 ");
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine(@"HIGH SPEED COMPRESSION FILE SYSTEM
VERSION {0}

COPYRIGHT (C) http://github.com/ralz0ne 2020.
", HscfsImage.VER);
            Console.ResetColor();
            HscfsDriver driver = new HscfsDriver(new HscfsImage());

            Dokan.Mount(driver, "n:");
        }
Exemplo n.º 8
0
        public static BuildFsFileSystem Mount(char letter, DokanOptions options)
        {
            Dokan.Unmount(letter);

            var fs = new BuildFsFileSystem();

            fs.Letter = letter;
            var t = Task.Run(() => Dokan.Mount(fs, letter + ":", options, 1));
            var e = Stopwatch.StartNew();

            while (e.ElapsedMilliseconds < 3000)
            {
                Thread.Sleep(200);
                if (t.Exception != null)
                {
                    throw t.Exception;
                }
                if (Directory.Exists(letter + ":\\"))
                {
                    return(fs);
                }
            }
            return(fs);
        }
Exemplo n.º 9
0
        public async void GetAccount()
        {
            var accinfo = await MegaClient.GetAccountInformationAsync();

            static_quota_max = accinfo.TotalQuota;
            MGFuseMain.dynamic_quota_used = accinfo.UsedQuota;
            MGFuseMain.dynamic_quota_free = static_quota_max - dynamic_quota_used;
            storageLabel.Text             = (static_quota_max / 1024 / 1024 / 1024) + " GB total\n" + (dynamic_quota_used / 1024 / 1024 / 1024) + " GB used\n" + (dynamic_quota_free / 1024 / 1024 / 1024) + " GB free";
            //Mount FUSE
            //dokan mount
            new Thread(() => { this.PerformSafely(() => { unmountBtn.Enabled = true; }); Dokan.Mount(new MegaFUSE.MFuseFS(new MegaFSHook()), DriveLetter.ToString() + ":\\", DokanOptions.FixedDrive, 5, null); }).Start();
        }
Exemplo n.º 10
0
 static void Main(string[] args)
 {
     Dokan.Mount(new ProcFS(), "p:\\", DokanOptions.RemovableDrive, 4, new NullLogger());
 }