Any one done anything with Jenda's Win32::FileType? Check out the below bit of code. Just trying to pull file association information. Seems I can get the association information, but not the Action, or Command that actually executes based on that association. This code has a TON of different attempts, none seem to work. I could write my own subroutine to go check out the registry directly, but if I could get this to work, that would be better.
    Any help would be appreciated.
        Thanks,
            Tim Thomas
 

use Win32::FileType;

check(".txt");

check(".pl");

check("Perl");

check(".doc");

check("Perl File");

check(".htm");

check(".html");

 

sub check {

print "-"x20,"\n";

($type)=@_;

if ($obj = Win32::FileType::Open($type))

{

my ($command,$title);

print "type=$type\n";

print "title=",$obj->Title,"\n";

print "name=",$obj->Name,"\n";

print "Icon=",$obj->Icon,"\n";

print "Extensions= (".join(', ',$obj->Extensions).")\n";

############################################################

#none of this stuff seems to work

#

#

print "Default Action=",$obj->DefaultAction,"\n";

print "Action=",$obj->Action("Open"),"\n";

($command,$title) = $obj->Action('&open') ;

print "command, title=$command, $title\n";

($command,$title) = $obj->Action('open') ;

print "command, title=$command, $title\n";

($command,$title) = $obj->Action("Open") ;

print "command, title=$command, $title\n";

($command,$title) = $obj->Action($type) ;

print "command, title=$command, $title\n";

$command = $obj->Action($obj->Title) ;

print "command, title=$command, $title\n";

($command,$title) = $obj->Action($obj->Title) ;

print "command, title=$command, $title\n";

($command,$title) = $obj->Action($obj->Name) ;

print "command, title=$command, $title\n";

$command = $obj->Action($obj->Name) ;

print "command=$command\n";

($command,$title) = $obj->Action('') ;

print "command, title=$command, $title\n";

($command,$title) = $obj->Action("/open/i") ;

print "command, title=$command, $title\n";

 

#print "Anything=",$obj->Anything(),"\n";

#($action, $title) = DDEAction($obj->Name);

#print "action, title=$action, $title\n";

#

#

#none of the above stuff seems to work

############################################################

$obj->Close

}

else {print "\"$type\" is not associated\n";}

}

-------------------------------------------------------------------------------------------------

Tim Thomas

Unix Systems Administrator

Lockheed Martin EIS · Denver Data Center

303-430-2281

mailto:[EMAIL PROTECTED]

-------------------------------------------------------------------------------------------------

test.pl

Reply via email to