Beispiel #1
0
    private void ReadFile()
    {
        // Ask for a file
        Gnome.Vfs.Uri uri = FileDialog.OpenFile("Read File");

        // Create Stream
        Gnome.Vfs.VfsStream vs = new Gnome.Vfs.VfsStream(uri.ToString(), FileMode.Open);

        // Read File byte by byte
        while (true)
        {
            int c = vs.ReadByte();

            if (c < 0)
            {
                Console.WriteLine("EOF");
                break;
            }

            Console.Write((char)c);
        }

        // Close File
        vs.Close();
    }
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestSyncWrite <uri>");
				return;
			}
		
			Gnome.Vfs.Vfs.Initialize ();

			Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]);
			
			Handle handle = Sync.Open (uri, OpenMode.Write);

			UTF8Encoding utf8 = new UTF8Encoding ();
			Result result = Result.Ok;
			Console.WriteLine ("Enter text and end with Ctrl-D");
			while (result == Result.Ok) {
				string line = Console.ReadLine ();
				if (line == null)
					break;
				byte[] buffer = utf8.GetBytes (line);

				ulong bytesWritten;
				result = Sync.Write (handle, out buffer[0],
						     (ulong)buffer.Length, out bytesWritten);
				Console.WriteLine ("result write '{0}' = {1}", uri, result);
				Console.WriteLine ("{0} bytes written", bytesWritten);
			}
			
			result = Sync.Close (handle);
			Console.WriteLine ("result close '{0}' = {1}", uri, result);
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
Beispiel #3
0
    private void OpenAsync()
    {
        // Ask for a file
        Gnome.Vfs.Uri uri = FileDialog.OpenFile("Open File Asynchronously");

        // Open the file Asynchronously
        Gnome.Vfs.AsyncCallback openCallback = new Gnome.Vfs.AsyncCallback(OnUriOpen);
        Gnome.Vfs.Async.Open(uri.ToString(), Gnome.Vfs.OpenMode.Read, 0, openCallback);
    }
Beispiel #4
0
        static void Main(string[] args)
        {
            TestXferOptions opt = new TestXferOptions();

            opt.ProcessArgs(args);

            if (opt.RemainingArguments.Length < 2)
            {
                opt.DoUsage();
                return;
            }

            XferOptions       options       = XferOptions.Default;
            XferOverwriteMode overwriteMode = XferOverwriteMode.Query;

            if (opt.recursive)
            {
                Console.WriteLine("Warning: Recursive xfer of directories.");
                options |= XferOptions.Recursive;
            }
            if (opt.followSymlinks)
            {
                Console.WriteLine("Warning: Following symlinks.");
                options |= XferOptions.FollowLinks;
            }
            if (opt.recursiveSymlinks)
            {
                Console.WriteLine("Warning: Following symlinks recursively.");
                options |= XferOptions.FollowLinksRecursive;
            }
            if (opt.replace)
            {
                Console.WriteLine("Warning: Using replace overwrite mode.");
                overwriteMode = XferOverwriteMode.Replace;
            }
            if (opt.deleteSource)
            {
                Console.WriteLine("Warning: Removing source files.");
                options |= XferOptions.Removesource;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri source = new Gnome.Vfs.Uri(opt.RemainingArguments[0]);
            Console.WriteLine("Source: `{0}'", source);
            Gnome.Vfs.Uri target = new Gnome.Vfs.Uri(opt.RemainingArguments[1]);
            Console.WriteLine("Target: `{0}'", target);

            Result result = Xfer.XferUri(source, target, options,
                                         XferErrorMode.Query,
                                         overwriteMode,
                                         new XferProgressCallback(OnProgress));

            Console.WriteLine("Result: {0}", Gnome.Vfs.Vfs.ResultToString(result));

            Gnome.Vfs.Vfs.Shutdown();
        }
        bool IPDFConverter.ConvertToPDF(string Src, out string PDFFile)
        {
            System.IO.FileInfo info = new System.IO.FileInfo(Src);
            PDFFile = Src;
            bool succeeded = true;

            Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri(Gnome.Vfs.Uri.GetUriFromLocalPath(info.FullName));
            Gnome.Vfs.MimeType mime = new Gnome.Vfs.MimeType(uri);

            if (mime != null && mime.Name.ToLower().StartsWith("image"))
            {
                Document document = null;
                try
                {
                    PDFFile = String.Format("/tmp/{0}.pdf", info.Name);

                    Image logo = Image.GetInstance(info.FullName);
                    // step 1: creation of a document-object
                    //Rectangle pageSize = new Rectangle(logo.GetRectangle(0, 0));

                    document = new Document();
                    document.SetMargins(0, 0, 0, 0);
                    document.SetPageSize(new Rectangle(logo.Width, logo.Height));

                    // step 2:
                    // we create a writer that listens to the document
                    // and directs a PDF-stream to a file
                    PdfWriter.GetInstance(document, new FileStream(PDFFile, FileMode.Create));

                    // step 3: we open the document
                    document.Open();

                    // step 4: we Add some paragraphs to the document
                    document.Add(logo);
                }
                catch(DocumentException de)
                {
                    Console.Error.WriteLine(de.Message);
                }
                catch(IOException ioe)
                {
                    Console.Error.WriteLine(ioe.Message);
                }

                // step 5: we close the document
                document.Close();
            }

            if (! System.IO.File.Exists(PDFFile))
            {
                PDFFile = null;
                succeeded = false;
            }

            return succeeded;
        }
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: TestCallback <uri>");
                return;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri(args[0]);
            Handle        handle;

            // Test 1: Attempt to access a URI requiring authentication w/o a callback registered.
            try {
                handle = Sync.Open(uri, OpenMode.Read);
                Sync.Close(handle);
                Console.WriteLine("Uri '{0}' doesn't require authentication", uri);
                return;
            } catch (VfsException ex) {
                if (ex.Result != Result.ErrorAccessDenied)
                {
                    throw ex;
                }
            }

            // Test 2: Attempt an open that requires authentication.
            ModuleCallbackFullAuthentication cb = new ModuleCallbackFullAuthentication();

            cb.Callback += new ModuleCallbackHandler(OnAuthenticate);
            cb.SetDefault();

            handle = Sync.Open(uri, OpenMode.Read);
            Sync.Close(handle);

            // Test 3: This call should not require any new authentication.
            Console.WriteLine("File info: \n{0}", uri.GetFileInfo());

            // Test 4: Attempt a call to the parent uri.
            FileInfo[] entries = Directory.GetEntries(uri.Parent);
            Console.WriteLine("Directory '{0}' has {1} entries", uri.Parent, entries.Length);

            // Test 5: Pop the authentication callback and try again.
            cb.Pop();
            try {
                handle = Sync.Open(uri, OpenMode.Read);
            } catch (VfsException ex) {
                if (ex.Result != Result.ErrorAccessDenied)
                {
                    throw ex;
                }
            }

            Gnome.Vfs.Vfs.Shutdown();
        }
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestCallback <uri>");
				return;
			}
		
			Gnome.Vfs.Vfs.Initialize ();

			Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]);
			Handle handle;

			// Test 1: Attempt to access a URI requiring authentication w/o a callback registered.
			try {
				handle = Sync.Open (uri, OpenMode.Read);
				Sync.Close (handle);
				Console.WriteLine ("Uri '{0}' doesn't require authentication", uri);
				return;
			} catch (VfsException ex) {
				if (ex.Result != Result.ErrorAccessDenied)
					throw ex;
			}
			
			// Test 2: Attempt an open that requires authentication.
			ModuleCallbackFullAuthentication cb = new ModuleCallbackFullAuthentication ();
			cb.Callback += new ModuleCallbackHandler (OnAuthenticate);
			cb.SetDefault ();
			
			handle = Sync.Open (uri, OpenMode.Read);
			Sync.Close (handle);

			// Test 3: This call should not require any new authentication.
			Console.WriteLine ("File info: \n{0}", uri.GetFileInfo ());
			
			// Test 4: Attempt a call to the parent uri.
			FileInfo[] entries = Directory.GetEntries (uri.Parent);
			Console.WriteLine ("Directory '{0}' has {1} entries", uri.Parent, entries.Length);
			
			// Test 5: Pop the authentication callback and try again.
			cb.Pop ();
			try {
				handle = Sync.Open (uri, OpenMode.Read);
			} catch (VfsException ex) {
				if (ex.Result != Result.ErrorAccessDenied)
					throw ex;
			}
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
Beispiel #8
0
    private void CreateAsync()
    {
        // Ask for a file
        Gnome.Vfs.Uri uri = FileDialog.SaveFile("Create File Asynchronously");

        // Create a file Asynchronously
        Gnome.Vfs.FilePermissions perms =
            Gnome.Vfs.FilePermissions.UserRead |
            Gnome.Vfs.FilePermissions.UserWrite |
            Gnome.Vfs.FilePermissions.GroupRead |
            Gnome.Vfs.FilePermissions.OtherRead;

        Gnome.Vfs.AsyncCallback createCallback = new Gnome.Vfs.AsyncCallback(OnUriCreate);
        Gnome.Vfs.Async.Create(uri, Gnome.Vfs.OpenMode.Write, false, perms, 0, createCallback);
    }
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestUnlink <uri>");
				return;
			}
		
			Gnome.Vfs.Vfs.Initialize ();

			Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]);
			Result result = uri.Unlink ();
			
			Console.WriteLine ("result unlink ('{0}') = {1}", uri, result);
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestSync <uri>");
				return;
			}
		
			Gnome.Vfs.Vfs.Initialize ();
			
			Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]);

			MimeType mimetype = uri.MimeType;
			Console.WriteLine ("Uri `{0}' looks like ", uri, mimetype.Name);
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
Beispiel #11
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: TestUnlink <uri>");
                return;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri uri    = new Gnome.Vfs.Uri(args[0]);
            Result        result = uri.Unlink();

            Console.WriteLine("result unlink ('{0}') = {1}", uri, result);

            Gnome.Vfs.Vfs.Shutdown();
        }
Beispiel #12
0
    private void ShowFileInfo()
    {
        // Ask for a file
        Gnome.Vfs.Uri uri = FileDialog.OpenFile("Show File Info");
        Console.WriteLine("Selected uri\t= {0}", uri.ToString());

        // MimeType
        string mimeType = Gnome.Vfs.MimeType.GetMimeTypeForUri(uri.ToString());

        Console.WriteLine("Mimetype\t= {0}", mimeType);

        // IsLocal
        Gnome.Vfs.FileInfoOptions options = Gnome.Vfs.FileInfoOptions.Default;
        Gnome.Vfs.FileInfo        info    = new Gnome.Vfs.FileInfo(uri.ToString(), options);

        Console.WriteLine("IsLocal\t\t= {0}", info.IsLocal);
    }
Beispiel #13
0
    private void WriteFile()
    {
        // Ask for a file
        Gnome.Vfs.Uri uri = FileDialog.SaveFile("Write to File");

        // Create Stream
        Gnome.Vfs.VfsStream vs = new Gnome.Vfs.VfsStream(uri.ToString(), FileMode.CreateNew);

        // Write to the file
        UTF8Encoding utf8 = new UTF8Encoding();

        byte [] buf = utf8.GetBytes("Testing 1 2 3, asdjfaskjdhfkajshdf");
        vs.Write(buf, 0, buf.Length);

        // Close the file
        vs.Close();
    }
Beispiel #14
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: TestSyncCreate <uri>");
                return;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri(args[0]);

            FilePermissions perms = FilePermissions.UserRead |
                                    FilePermissions.UserWrite |
                                    FilePermissions.GroupRead |
                                    FilePermissions.OtherRead;

            Console.WriteLine(perms);
            Handle handle = Sync.Create(uri, OpenMode.Write, false, perms);

            UTF8Encoding utf8   = new UTF8Encoding();
            Result       result = Result.Ok;

            Console.WriteLine("Enter text and end with Ctrl-D");
            while (result == Result.Ok)
            {
                string line = Console.ReadLine();
                if (line == null)
                {
                    break;
                }
                byte[] buffer = utf8.GetBytes(line);

                ulong bytesWritten;
                result = Sync.Write(handle, out buffer[0],
                                    (ulong)buffer.Length, out bytesWritten);
                Console.WriteLine("result write '{0}' = {1}", uri, result);
                Console.WriteLine("{0} bytes written", bytesWritten);
            }

            result = Sync.Close(handle);
            Console.WriteLine("result close '{0}' = {1}", uri, result);

            Gnome.Vfs.Vfs.Shutdown();
        }
Beispiel #15
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: TestSync <uri>");
                return;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri(args[0]);

            MimeType mimetype = uri.MimeType;

            Console.WriteLine("Uri `{0}' looks like ", uri, mimetype.Name);

            Gnome.Vfs.Vfs.Shutdown();
        }
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestInfo <uri>");
				return;
			}
		
			Gnome.Vfs.Vfs.Initialize ();

			Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]);
			
			FileInfoOptions options = FileInfoOptions.GetMimeType |
						  FileInfoOptions.FollowLinks |
						  FileInfoOptions.GetAccessRights;
			FileInfo info = uri.GetFileInfo (options);
			Console.WriteLine (info.ToString ());
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
Beispiel #17
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: TestSync <uri>");
                return;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri uri    = new Gnome.Vfs.Uri(args[0]);
            Handle        handle = Sync.Open(uri, OpenMode.Read);

            UTF8Encoding utf8 = new UTF8Encoding();

            byte[] buffer = new byte[1024];
            Result result = Result.Ok;

            while (result == Result.Ok)
            {
                ulong bytesRead;
                result = Sync.Read(handle, out buffer[0],
                                   (ulong)buffer.Length, out bytesRead);
                Console.WriteLine("result read '{0}' = {1}", uri, result);
                if (bytesRead == 0)
                {
                    break;
                }
                Console.WriteLine("read ({0} bytes) : '{1}'",
                                  bytesRead, utf8.GetString(buffer, 0, (int)bytesRead));
            }

            string test;

            result = Sync.FileControl(handle, "file:test", out test);
            Console.WriteLine("result filecontrol '{0}' = {1}", uri, result);
            Console.WriteLine("result file:test = {0}", test);

            result = Sync.Close(handle);
            Console.WriteLine("result close '{0}' = {1}", uri, result);

            Gnome.Vfs.Vfs.Shutdown();
        }
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestAsync <uri>");
				return;
			}
		
			Gnome.Vfs.Vfs.Initialize ();

			Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]);
			handle = Async.Open (uri, OpenMode.Read,
					     (int)Async.Priority.Default,
					     new Gnome.Vfs.AsyncCallback (OnOpen));
			
			loop = new MainLoop ();
			loop.Run ();
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
Beispiel #19
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: TestAsync <uri>");
                return;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri(args[0]);
            handle = Async.Open(uri, OpenMode.Read,
                                (int)Async.Priority.Default,
                                new Gnome.Vfs.AsyncCallback(OnOpen));

            loop = new MainLoop();
            loop.Run();

            Gnome.Vfs.Vfs.Shutdown();
        }
Beispiel #20
0
        static void Main(string[] args)
        {
            if (args.Length != 1)
            {
                Console.WriteLine("Usage: TestInfo <uri>");
                return;
            }

            Gnome.Vfs.Vfs.Initialize();

            Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri(args[0]);

            FileInfoOptions options = FileInfoOptions.GetMimeType |
                                      FileInfoOptions.FollowLinks |
                                      FileInfoOptions.GetAccessRights;
            FileInfo info = uri.GetFileInfo(options);

            Console.WriteLine(info.ToString());

            Gnome.Vfs.Vfs.Shutdown();
        }
		static void Main (string[] args)
		{
			if (args.Length != 1) {
				Console.WriteLine ("Usage: TestSync <uri>");
				return;
			}
		
			Gnome.Vfs.Vfs.Initialize ();

			Gnome.Vfs.Uri uri = new Gnome.Vfs.Uri (args[0]);
			Handle handle = Sync.Open (uri, OpenMode.Read);

			UTF8Encoding utf8 = new UTF8Encoding ();
			byte[] buffer = new byte[1024];
			Result result = Result.Ok;			
			while (result == Result.Ok) {
				ulong bytesRead;
				result = Sync.Read (handle, out buffer[0],
						    (ulong)buffer.Length, out bytesRead);
				Console.WriteLine ("result read '{0}' = {1}", uri, result);
				if (bytesRead == 0)
					break;
				Console.WriteLine ("read ({0} bytes) : '{1}'",
						   bytesRead, utf8.GetString (buffer, 0, (int)bytesRead));
			}
			
			string test;
			result = Sync.FileControl (handle, "file:test", out test);
			Console.WriteLine ("result filecontrol '{0}' = {1}", uri, result);
			Console.WriteLine ("result file:test = {0}", test);
			
			result = Sync.Close (handle);
			Console.WriteLine ("result close '{0}' = {1}", uri, result);
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
Beispiel #22
0
        public void set_picture_path()
        {
            string uri = Gnome.Vfs.Uri.GetUriFromLocalPath(item.path);

            string image_uri = Gnome.Thumbnail.PathForUri(uri, Gnome.ThumbnailSize.Normal);
            if (System.IO.File.Exists(image_uri))
            {
                pic_path = image_uri;
            }
            else
            {
                using (Gnome.ThumbnailFactory factory = new Gnome.ThumbnailFactory(Gnome.ThumbnailSize.Normal)) {

                    System.DateTime mtime = System.IO.File.GetLastWriteTime(item.path);

                    using (Gnome.Vfs.Uri vfs_uri = new Gnome.Vfs.Uri(item.path)) {
                        string mime = vfs_uri.MimeType.Name;

                        if (factory.HasValidFailedThumbnail(uri, mtime)) {
                            pic_path = "/usr/share/nemo/no-preview.png";
                            return;
                        }

                        System.Console.WriteLine("trying to thumbnail {0}", item.path);

                        System.Console.WriteLine(mime);

                        if (factory.CanThumbnail(uri, mime, mtime))
                        {
                            Gdk.Pixbuf thumb = factory.GenerateThumbnail(uri, mime);
                            if (thumb == null)
                            {
                                System.Console.WriteLine("failed to generate thumbnail");
                                factory.CreateFailedThumbnail(uri, mtime);
                                pic_path = "/usr/share/nemo/no-preview.png";
                            }
                            else {
                                factory.SaveThumbnail(thumb, uri, mtime);
                                set_picture_path(); // use the new picture
                            }
                        }
                        else
                        {
                            factory.CreateFailedThumbnail(uri, mtime);
                            System.Console.WriteLine("Can't thumbnail");
                            pic_path = "/usr/share/nemo/no-preview.png";
                        }
                    }
                }
            }
        }
Beispiel #23
0
        private DrapesApp(string[] args)
        {
            // Initialize the i18n bits
            Catalog.Init("drapes", CompileOptions.GnomeLocaleDir);

            Gtk.Application.Init("Drapes", ref args);
            Vfs.Vfs.Initialize();

            // Load settings for us
            Cfg = new Config.Settings();

            // Process application arguments
            ProcessArgs(args);

            // If Monitor is enabled, make sure the dir exists as well
            if (Cfg.MonitorEnabled == true)
                // If it dosen't exist turn of monitoring
                if (Cfg.MonitorDirectory == null) {
                    Cfg.MonitorEnabled = false;
                    Cfg.MonitorDirectory = "unset";
                }

            // Check if we already have file with wallpapers, else assume first start
            Vfs.Uri cfg = new Vfs.Uri(Config.Defaults.DrapesWallpaperList);
            if (!cfg.Exists) {
                if (Cfg.Debug == true)
                    Console.WriteLine(Catalog.GetString("Importing Gnome's background list: {0}"), Config.Defaults.Gnome.WallpaperListFile);

                WpList = new WallPaperList(Config.Defaults.Gnome.WallpaperListFile);

                // Lets save it in our own format
                WpList.SaveList(Config.Defaults.DrapesWallpaperList);
            } else {
                if (Cfg.Debug == true)
                    Console.WriteLine(Catalog.GetString("Opening wallpaper list: {0}"), Config.Defaults.DrapesWallpaperList);

                WpList = new WallPaperList(Config.Defaults.DrapesWallpaperList);
            }

            // Wallpaper switcher (check every 10 seconds or so)
            GLib.Timeout.Add(20000, TimerSwitcher);
            // Waite a couple secons before doing first random, otl et it lazy load somethings
            GLib.Timeout.Add(5000, OnstartSwitch);

            // tray Icon
            if (AppletStyle == AppletStyle.APPLET_TRAY) {
                new AppletWidget(AppletStyle, null);
                Gtk.Application.Run();
            } else
                DrapesApplet.Run(ref args);
        }
		static void Main (string[] args)
		{
			TestXferOptions opt = new TestXferOptions ();
			opt.ProcessArgs (args);
			
			if (opt.RemainingArguments.Length < 2) {
				opt.DoUsage ();
				return;
			}
			
			XferOptions options = XferOptions.Default;
			XferOverwriteMode overwriteMode = XferOverwriteMode.Query;
			if (opt.recursive) {
				Console.WriteLine ("Warning: Recursive xfer of directories.");
				options |= XferOptions.Recursive;
			}
			if (opt.followSymlinks) {
				Console.WriteLine ("Warning: Following symlinks.");
				options |= XferOptions.FollowLinks;
			}
			if (opt.recursiveSymlinks) {
				Console.WriteLine ("Warning: Following symlinks recursively.");
				options |= XferOptions.FollowLinksRecursive;
			}
			if (opt.replace) {
				Console.WriteLine ("Warning: Using replace overwrite mode.");
				overwriteMode = XferOverwriteMode.Replace;
			}
			if (opt.deleteSource) {
				Console.WriteLine ("Warning: Removing source files.");
				options |= XferOptions.Removesource;
			}
			
			Gnome.Vfs.Vfs.Initialize ();
			
			Gnome.Vfs.Uri source = new Gnome.Vfs.Uri (opt.RemainingArguments[0]);
			Console.WriteLine ("Source: `{0}'", source);
			Gnome.Vfs.Uri target = new Gnome.Vfs.Uri (opt.RemainingArguments[1]);
			Console.WriteLine ("Target: `{0}'", target);

			Result result = Xfer.XferUri (source, target, options,
						      XferErrorMode.Query,
						      overwriteMode,
						      new XferProgressCallback (OnProgress));
			Console.WriteLine ("Result: {0}", Gnome.Vfs.Vfs.ResultToString (result));
			
			Gnome.Vfs.Vfs.Shutdown ();
		}
Beispiel #25
0
 // Methods :: Public :: Exists
 /// <summary>
 ///	Checks to see if the URI exists.
 /// </summary>
 /// <param name="fn">
 ///	The URI to check.
 /// </param>
 /// <returns>
 ///	True if the URI exists, False otherwise.
 /// </returns>
 public static bool Exists(string fn)
 {
     Gnome.Vfs.Uri u = new Gnome.Vfs.Uri(fn);
     return(u.Exists);
 }