[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  FILESIZE

  .  Summary

  filesize(str <filespec>);

  .  Description

  The filesize function returns the size in bytes of the specified
  file. <filespec> is the name of the file and may include a drive and
  directory portion, as well as the DOS wildcard characters * and ?.

  If <filespec> is blank (""), then the size of the last file found
  with the filefind function is returned. Note that calling filetime
  or fileattr in the meantime with a non-blank filename would instead
  make this call return the size of files found with those functions,
  as they use the same buffer.

  .  Return Value

  An integer value representing the size of the indicated file is re-
  turned, or a value of -1 is returned if the indicated file could not
  be found.

  .  Example

  str filespec[24] = "*.*", buf[12];
  int size;
  siz = filesize("TELIX.EXE");   // get size of file TELIX.EXE

  // Add up size of all files int he current directory
  siz = 0;
  while (filefind(filespec, 0, buf) != 0)   // until no more files
   {
    siz = siz + filesize("");   // get size of last filefound file
    filespec = "";              // make sure filespec is "" on sub-
                                // sequent calls to filefind to
                                // continue searching for files
   }

See Also: filefind filetime fileattr
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson