Determine the size of a file

From CodeCodex

Revision as of 22:30, 16 December 2006 by 71.197.105.227 (Talk)

Implementations

Common Lisp

Quite easy with Common Lisp:

> (with-open-file (file "output.swf") (file-length file))
193842

Java

    File file = new File("infilename");
    
    // Get the number of bytes in the file
    long length = file.length();