#filesize()

DESCRIPTION
    returns a file's size (in bytes)
SYNOPSIS
    #filesize(s)
ARGUMENTS
    s - a quoted string, or string expression, representing a filepath
EXAMPLES
# pikt +C 'output $text(#filesize("/etc/passwd"))'
2139
        rule
                set #fs = #filesize($inlin)

        rule
                if #fs != %fs
                        output mail "for $inlin, size has changed, is $text(#fs) bytes, was $text(%fs) bytes"
                fi
        rule
                if -e $name
                        set #size = #filesize($name)
                else
                        output mail "$name not found!"
                        set #size = 0
                        next
                endif
        rule    // get log file size, in lines for text files, and KB for
                // binary files
                set #size = #if(#binary, #filesize($name)/=KB,
                                         #val($command("=wc -l $name | =awk '{print \$1}'")))
SEE ALSO
    #fileino()
    #filelinks()
    #fileuid()
    #filegid()
    #fileatime()
    #filectime()
    #filemtime()

    Numerical Functions
    String Functions
 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2008-03-27.   This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.   Copyright © 1998-2008 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
Learn about the
piktd
program