« Return to Thread: GIO# FileFactory.NewForCommandlineArgs System.EntryPointNotFoundException

Re: GIO# FileFactory.NewForCommandlineArgs System.EntryPointNotFoundException

by Christian Hoff :: Rate this Message:

Reply to Author | View in Thread

Yes, the GIO function is actually called g_file_new_for_commandline_arg
  ;-) . Attached is a simple patch to fix the issue(I think we can break
compatibility here since the old implementation was non-working).
Stephane, could you review? I assume the patch has to go into the
gio-sharp module as well?

Christian

Dan Saul wrote:

> Hi,
>
> I have compiled Mono# from SVN to get access to GIO#. For the most
> part it works, I have no problem with the code:
>
> base_dir = FileFactory.NewForPath(v);
>
> However if I change it to
>
> base_dir = FileFactory.NewForCommandlineArgs(v);
>
> I would like to change this so that one can enter a URI or a Path on
> the command line.
>
> I recieve the following exception:
>
> Unhandled Exception: System.EntryPointNotFoundException:
> g_file_new_for_commandline_args
>
> Dan
> ------------------------------------------------------------------------
>
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list@...
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
>  

Index: gio/FileFactory.cs
===================================================================
--- gio/FileFactory.cs (Revision 136072)
+++ gio/FileFactory.cs (Arbeitskopie)
@@ -49,11 +49,11 @@
  }
 
  [DllImport ("libgio-2.0-0.dll")]
- private static extern IntPtr g_file_new_for_commandline_args (string args);
+ private static extern IntPtr g_file_new_for_commandline_arg (string arg);
 
- public static File NewForCommandlineArgs (string args)
+ public static File NewFromCommandlineArg (string arg)
  {
- return GLib.FileAdapter.GetObject (g_file_new_for_commandline_args (args), false) as File;
+ return GLib.FileAdapter.GetObject (g_file_new_for_commandline_arg (arg), false) as File;
  }
  }
 }

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@...
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

 « Return to Thread: GIO# FileFactory.NewForCommandlineArgs System.EntryPointNotFoundException