About stat problem ??

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default About stat problem ??

    Dear all

    I found that stat command problems, when the file is over 2GB , it
    cannot return any result when i use stat command. The following are the
    information:

    -rw-r--r-- 1 root root 75k Aug 10 08:27 ksyms.6
    -rw-r--r-- 1 root root 18M Sep 11 02:13 lastlog
    -rw-r--r-- 1 root root 2.9G Sep 11 02:59 maillog

    The program is:

    #!/usr/bin/perl -w
    use strict;

    my $filename = "/var/log/maillog";

    my
    ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$ati me,$mtime,$ctime,$blksize,$blocks)
    = stat($filename);

    print "print result for $filename is
    $dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atim e,$mtime,$ctime,$blksize,$blocks
    \n";

    The result is :
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    Use of uninitialized value in concatenation (.) or string at ./test.pl
    line 8.
    print result for /var/log/maillog is ,,,,,,,,,,,,

    If we run the same program , but change filename to /var/log/lastlog.
    the result is :
    print result for /var/log/lastlog is
    2306,311299,33188,1,0,0,0,19136220,1063246432,1063 246432,1063246432,4096,37424


    My machine is using redhat 7.3 and the perl version is perl-5.6.1-34.99.6

    Anyone has ideas on it ? is it bug on this perl version ? Please give
    me some advise , Thanks a lot

    Sum


    Sum Guest

  2. Similar Questions and Discussions

    1. #28790 [Com]: Add option to disable stat cache
      ID: 28790 Comment by: james at bytehosting dot com Reported By: jnoll at prim dot hu Status: Assigned Bug...
    2. Help! I need to know how to use a cookie stat!
      Hey guys I am currently making my first dynamic website and am using the most recent version of Macromedia Studio. the site is almost done but I...
    3. Could not stat error message
      Joe Burns typed (on Mon, Aug 11, 2003 at 09:43:38PM -0400): | I am trying to create a "tar" output file of the "/usr2" filesystem into a | storage...
    4. stat question
      Hello, A while ago someone suggested using the stat command to get modification times for files etc, ls -al will give the info but I would have...
    5. lsof & non-stat()-ble NFS server
      Hello, We're getting errors in /var/adm/messages saying that an NFS directory is not writable: Jul 17 09:04:33 XXXXXXX nfs: NFS write error...
  3. #2

    Default Re: About stat problem ??

    On Wednesday, September 10, 2003, at 10:04 PM, sum wrote:
    > Dear all
    >
    > I found that stat command problems, when the file is over 2GB , it
    > cannot return any result when i use stat command. The following are
    > the information:
    <snip>
    > My machine is using redhat 7.3 and the perl version is
    > perl-5.6.1-34.99.6
    >
    > Anyone has ideas on it ? is it bug on this perl version ? Please
    > give me some advise , Thanks a lot
    I'm not sure, but my gut reaction is that this sounds like an OS
    problem. Does anyone know if Red Hat 7.3 can handle files over 2 Gigs?

    Sorry if that's not much help.

    James

    James Edward Gray II Guest

  4. #3

    Default Re: About stat problem ??

    James Edward Gray II wrote:
    > On Wednesday, September 10, 2003, at 10:04 PM, sum wrote:
    >
    >> Dear all
    >>
    >> I found that stat command problems, when the file is over 2GB , it
    >> cannot return any result when i use stat command. The following are
    >> the information:
    >
    > <snip>
    >
    >> My machine is using redhat 7.3 and the perl version is
    >> perl-5.6.1-34.99.6
    >>
    >> Anyone has ideas on it ? is it bug on this perl version ? Please
    >> give me some advise , Thanks a lot
    >
    > I'm not sure, but my gut reaction is that this sounds like an OS
    > problem. Does anyone know if Red Hat 7.3 can handle files over 2 Gigs?
    RH 7.3 is shipped with at least kernel 2.4.18-14 which supports LFS (Large
    File Support). if you do:

    [panda]$ uname -r
    2.4.18-14

    you should see something similiar to the above. it's still possible to
    rebuild your kernel to have LFS support even if the kernel is < 2.4.x but
    that's another story. if your kernel does not support LFS, Perl won't be
    able to support it. if your kernel does support LFS, chances are Perl will
    also support LFS. you can check to see if your Perl was built to support
    LFS by:

    [panda]$ perl -V | grep uselargefiles

    and if you see something like 'uselargefiles=define' then you are in good
    shape. finally, you also want to check if perl is built to use the LFS API:

    [panda]$ perl -V | grep OFFSET_BIT

    -D_GNU_SOURCE -fno-strict-aliasing -D_LARGEFILE_SOURCE
    -D_FILE_OFFSET_BITS=64

    it's highly unlikely that perl is not using the LFS API if it's capable of
    handling large file. RH 7.3 and Perl that came with it, should support LFS
    right out of the box.

    david
    --
    $_=q,015001450154015401570040016701570162015401440 041,,*,=*|=*_,split+local$";
    map{~$_&1&&{$,<<=1,$#.=qq~\x63\x68\x72\x28@_[$_..$||3])=>~}}0..s~.~~g-1;*_=*#,

    goto=>print+eval
    David Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139