Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Novlib 3.30 Online Reference - <b> dirfilelist()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DirFileList()
------------------------------------------------------------------------------
 Purpose:
 List or change file names in a directory.

 Syntax:
 lpszFile = DirFileList( lpszFileSpec, lpszNewName )

 Parameters:
 lpszFileSpec The full NetWare directory path (filespec) of the file(s).
 lpszNewName  The new file name for a specific file.

 Returns:
 A character string of length 14.

 The CA-Clipper name for this function is:
 DirFilLst()

 Description:
 DirFileList() is used to return a list of file names based on a filespec
 specified by lpszFileSpec, or to change a file name for a given file.

 To return a list of files from a given directory, DirFileList() should be
 called once with parameter lpszFileSpec, and then called repeatedly passing
 a NULL string ("") as lpszFileSpec until a NULL string is returned,
 signifying the end of the list.

 On the initial call, lpszFileSpec must be the full directory path including
 the volume name and the filespec of the files to be searched. The wildcards
 "*" and "?" can be used. For example, to return a list of all files in
 SYS:DATA, lpszFileSpec would be "SYS:DATA\*.*".

 To change a file's name, lpszFileSpec must be passed as the full file spec
 including the file name, for example SYS:DATA\KATIE.DOC and lpszNewName
 must be passed as just the new file name WITHOUT the path. When not
 renaming the file, lpszNewName should be passed as a NULL string.
 Returns an empty string if an error occurs.

 Example:
 // To return a list of files in "SYS:DATA" and their creation details:
 lpszNameStr = DirFileList( "SYS:DATA\*","" )
 do while !empty( NameStr )
    ? lpszNameStr, FilCreateDateGet(), FilCreateTimeGet()
    lpszNameStr = DirFileList( "","" )
 enddo
 // To change the name of SYS:DATA\KATIE.DOC to KATHRYN.DOC:
 lpszNameStr = DirFileList( "SYS:DATA\KATIE.DOC", "KATHRYN.DOC" )
 if( !empty( lpszNameStr ) )
    ? "File SYS:DATA\KATIE.DOC is now called", lpszNameStr
 endif

 Notes:
 Other file functions, such as FilCreateDateSet() and
 FilCreateTimeSet(), can be called directly after DirFileList() to return
 further information on the file as shown above. After an empty string is
 returned, check NWErrorGet().

 Appropriate trustee access rights are required.

See Also: FilCreateDateGet() / FilCreateDateSet() FilCreateTimeGet() / FilCreateTimeSet() FilOwnerIDGet() / FilOwnerIDSet()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson