User Profile

Collapse

Profile Sidebar

Collapse
rgolub
rgolub
Last Activity: Mar 28 '08, 06:49 PM
Joined: Mar 3 '08
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • rgolub
    replied to Age of the file
    in Perl
    I am getting a syntax error:

    [CODe=perl]#!/usr/bin/perl

    use Time::localtime ;
    use Time::Local;

    opendir(DIR,$di r_to_open) || die("Cannot open directory !\n");
    @dir_contents= readdir(DIR);
    closedir(DIR);

    foreach $file (@dir_contents)
    {
    if(!(($file eq ".") || ($file eq "..")))
    {
    my $now = time;
    ...
    See more | Go to post
    Last edited by eWish; Mar 4 '08, 04:54 PM. Reason: Please use code tags

    Leave a comment:


  • rgolub
    replied to Age of the file
    in Perl
    thank you for you respond,

    I don't get value of ctime, please see code below:
    -----------------------------------------------------------------------------------
    [CODE=perl]opendir(DIR,$di r_to_open) || die("Cannot open directory !\n");

    @dir_contents= readdir(DIR);
    closedir(DIR);

    foreach $file (@dir_contents)
    {
    if(!(($file eq ".") || ($file eq "..")))...
    See more | Go to post
    Last edited by eWish; Mar 4 '08, 02:41 PM. Reason: Please use code tags

    Leave a comment:


  • rgolub
    started a topic Age of the file
    in Perl

    Age of the file

    I am trying define age of the file in seconds. If file > 900 (15 minutes), I would like get an alert. OS is Windows. For some reason I am getting negative number when I compare System time with file time.

    [CODE=perl]if( -f "$Dir/$FileName" ) {
    my($dev,$ino,$m ode,$nlink,$uid ,$gid,$rdev,$si ze,$atime,$mtim e,$ctime,$blksi ze,$blocks) = stat("$Dir/$FileName");
    my $time_diff = ($now - $ct...
    See more | Go to post
    Last edited by eWish; Mar 3 '08, 11:30 PM. Reason: Please use code tags
No activity results to display
Show More
Working...