SkÃ¥ne Sjælland Linux User Group - http://www.sslug.dk Forside   Tilmelding   Postarkiv   Forum   Kalender   Søg
MhonArc Dato: [Date Prev] [Kronologisk oversigt] [Date Next]   TrÃ¥d: [Date Prev] [Oversigt trÃ¥de] [Date Next]   MhonArc
 

Re: [PERL] $var = -s filnavn; <- filnavn i $var ?



On Sun, 17 Jun 2001, Jesper Lund wrote:

> Ey,
> 
> Jeg skal have størelsen af en fil ned i en variabel, jeg har prøvet med
> en $var = -s filnavn;
> 
>  Men det får jeg bare en Undef eller en tom variabel.
> 
> Hvor går det galt ?

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

               Not all fields are supported on all filesystem
               types.  Here are the meaning of the fields:

                 0 dev      device number of filesystem
                 1 ino      inode number
                 2 mode     file mode  (type and permissions)
                 3 nlink    number of (hard) links to the file
                 4 uid      numeric user ID of file's owner
                 5 gid      numeric group ID of file's owner
                 6 rdev     the device identifier (special files only)
        ==>      7 size     total size of file, in bytes
                 8 atime    last access time in seconds since the epoch
                 9 mtime    last modify time in seconds since the epoch
                10 ctime    inode change time (NOT creation time!) in seconds si
nce the epoch
                11 blksize  preferred block size for file system I/O
                12 blocks   actual number of blocks allocated

               (The epoch was at 00:00 January 1, 1970 GMT.)



> 
> Mvh. Jesper
> 
> 

Regards, Lars
Student at Department of Computer Science and Department of Psychology  
University of Copenhagen --- http://www.diku.dk/students/larsj/     
When's the last time you used duct tape on a duct? -- Larry Wall



 
Forside   Tilmelding   Postarkiv   Oversigt   Kalender   Søg

 
 
Henvendelse vedrørende websiderne til <www_admin>. Senest ændret 2005-08-10, klokken 19:53
Denne side vedligeholdes af MHonArc .