xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

FileSeek()

Seeks files specified by a file mask and file attributes.

Syntax

FileSeek( [<cFileMask>]  , ;
          [<nAttributes>]  ) --> cFileName

Arguments

<cFileMask>
This is a character string holding the drive, directory and/or file specification of the file(s) to seek. It may contain "wild card characters" (eg: "c:\xhb\data\*.cdx").
<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

Returns a filename matching the specified parameters or a null string ("") if no further file is found.

Description

The parameters for FileSeek() must be specified for an initial call of the function. Subsequent calls can be performed without parameters. FileSeek() returns the next file matching the initial parameters until no further file is found.

Info

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

Example

// The example displays all PRG files in the current directory

   PROCEDURE Main
      LOCAL cFileName

      ? cFileName := FileSeek( "*.prg" )

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

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