xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

FileTime()

Returns the change time of a file.

Syntax

FileTime( [<cFileName>], [<nAttributes>] ) --> cFileTime

Arguments

<cFileName>
This is an optional character string containing the name of the file to query. It defaults to the last file found with FileSeek(). If specified, it must contain a file extension. If <cFileName> contains no drive and/or directory information, the current directory is used. SET DEFAULT and SET PATH settings are ignored.
<nAttributes>
This is a numeric value specifying the file attributes of the files to query. Values of the following list are used for file attributes. To specifiy multiple attributes, pass the sum of the corresponding values:

Values for file attributes
ValueAttribute
0Normal
1Read only
2Hidden
4System
8Volume
16Directory
32Archived

Return

The function returns the time of the specified file in bytes as a Time() formatted character string, or a null string ("") in case of an error.

Info

See also:FileAttr(), FileDate(), FileSeek(), FileSize()
Category: CT:DiskUtil , File functions , Low level file functions
Source:ct\files.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example lists file name and time of all PRG files
// in the current directory.

   PROCEDURE Main
      LOCAL cFileName

      cFileName := FileSeek( "*.prg" )

      DO WHILE .NOT. Empty( cFileName )
         ? cFileName, FileTime()
         cFileName := FileSeek()
      ENDDO
   RETURN

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