Re: Gnome2::VFS::FileInfo->get_mime_type



On Fri, 2004-07-09 at 13:28, Gavin Brown wrote:

# this is just a simple one-liner to create A URI for this file:
my $file = URI::URL->new($0, sprintf('file://%s', $ENV{PWD}))->abs->as_string;

Here's the problem.  $file is "file:///home/gnome-vfs-mimetpe-test.pl",
which means that URI::URL somehow stripped the trailing directory.

my $info = Gnome2::VFS->get_file_info($file, 'get-mime-type');

Most gnome-vfs functions also return a GnomeVFSResult, which is quite
helpful in this case:

  my ($result, $info) = Gnome2::VFS->get_file_info($file, 'get-mime-type');
  warn "result: $result";

That gives "result: error-not-found".

Bye,
-Torsten




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]