Gnome2::VFS::FileInfo->get_mime_type



Below is a script that, as far as I can tell, should print out the MIME
type (as determined by GnomeVFS) of itself. But I can't get it to print
anything. I'm not sure if this is a bug or maybe my code's wrong.
Torsten's busy so I thought I'd pass it out the list.

Cheers,

Gavin.

#!/usr/bin/perl
use Gnome2::VFS;
use URI::URL;
use strict;

# 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;

Gnome2::VFS->init;

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

print "\$info is a '".ref($info)."' object\n";

print "MIME type is: ".$info->get_mime_type."\n";

exit;

-- 
Gavin Brown
e: gavin brown uk com
w: http://jodrell.net/
PGP/GPG key ID: 891D8FCA

Attachment: gnome-vfs-mimetpe-test.pl
Description: Perl program

Attachment: gnome-vfs-mimetpe-test.pl
Description: Perl program



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