Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help Kirsle

Status
Not open for further replies.

gammaman64

Programmer
Apr 28, 2007
9
US
I think we have a misunderstanding. The text that the user types in the widget, is a file on the users HHD, I want that file that the user types in to be looked for, so that it can return to the dos window the information being searched for.



sub check {
my $check = $mw->DialogBox(
-background => 'red',
-title => 'Type the file you wish to check',
-buttons => [ 'OK', 'Cancel' ],
-default_button => 'OK',
);

my $txt;
my $entry = $check->Entry (
-textvariable => \$txt,
)->pack;

my $click = $check->Show();

return unless $click eq 'OK';

foreach my $try (@ARGV){

print ("Checking $txt\n");

if (-f $txt)
{


print ("The file $txt is:");
print ("readable") if (-r $txt);
print ("writable") if (-w $txt);
print ("executable") if (-x $txt);
}



elsif (-d $txt)
{
print ("$txt is a directory");


my @time = timeconv(-A $txt);
print "The file was last accessed at $time[0] days, ",
"$time[1] hours, $time[2] minutes ",
"and $time[3] seconds.\n";


}
}
}




sub timeconv{

my $time = shift();
my $days = int ($time);
$time = ($time - $days) * 24;
my $hours = int ($time);
$time = ($time - $hours) * 60;
my $minutes = int ($time);
$time = ($time - $minutes) * 60;
my $seconds = int ($time);
return ($days, $hours, $minutes, $seconds);

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top