xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_FSize()

Returns the size of a file in bytes.

Syntax

HB_FSize( <cFileName> ) --> nFileSize

Arguments

<cFileName>
This is a character string holding the name of the file to query. It must include path and file extension. If the path is omitted from <cFileName>, the file is searched in the current directory.

Return

The function returns a numeric value indicating the size of the file <cFileName> in bytes. If the file does not exist, the return value is 0.

Description

Function HB_FSize() is used to determine the size of a single file in bytes. Note that the return value of this function is 0 for an existing file with no contents and for a none existing file. Use function File() to check for the existence of a file.

Info

See also:Directory(), FileStats(), FCreate(), FOpen()
Category: Low level file functions , xHarbour extensions
Source:rtl\fssize.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays the size of a single file

   PROCEDURE Main
      LOCAL cFileName := "HB_FSize.prg"

      ? HB_FSize( cFileName )
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe