Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > Problem with ST...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 10831 of 11751
Post > Topic >>

Problem with STAT under Windows

by anders.u.persson@[EMAIL PROTECTED] (Anders) Mar 31, 2008 at 03:15 AM

I tryed some testkod below, i like Perl to give med TIME for every
file,
But all variable just get blank, (i got filename).

# Reads all files to a list
sub readFileList {
    my @[EMAIL PROTECTED]
    local $dev;
    local $ino;
    local $mode;
    local$nlink;
    local $uid;
    local $gid;
    local $rdev;
    local $size;
    local $atime;
    local $mtime;
    local $ctime;
    local $blksize;
    local $blocks;

    local @[EMAIL PROTECTED]
    local $dir_to_open="f:\\backupsv";
    opendir(DIR,$dir_to_open) || die("Cannot open directory !\n");
    @[EMAIL PROTECTED]
 readdir(DIR); # Get contents of directory
    closedir(DIR); # Close the directory

    # Now loop through array and print file names
    foreach $file (@[EMAIL PROTECTED]
) {
       if( substr($file,-3,3) eq "TXT" )   { # $file =~ /\*.txt/
        ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,
$ctime,$blksize,$blocks) = stat($file);
            # getRefDate();
            print "File is $file\n";
            # push @[EMAIL PROTECTED]
                print "size $size \n";
                print "atime $atime \n";
                print "mtime $mtime \n";
                print "ctime $ctime \n";
            exit(0);
       }
     }
    return @[EMAIL PROTECTED]

 




 2 Posts in Topic:
Problem with STAT under Windows
anders.u.persson@[EMAIL P  2008-03-31 03:15:35 
Re: Problem with STAT under Windows
noreply@[EMAIL PROTECTED]  2008-03-31 16:11:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Sep 7 6:41:39 CDT 2008.