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> dirfillst()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DirFilLst()
------------------------------------------------------------------------------
 Purpose:
 List or change file names in a directory.

 Syntax:
 lpszFile = DirFilLst( 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.

 Description:
 DirFilLst() 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, DirFilLst() 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 = DirFilLst( "SYS:DATA\*","" )
 do while !empty( NameStr )
    ? lpszNameStr, FilCreDteGet(), FilCreTmeGet()
    lpszNameStr = DirFilLst( "","" )
 enddo
 // To change the name of SYS:DATA\KATIE.DOC to KATHRYN.DOC:
 lpszNameStr = DirFilLst( "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 FilCreDteSet() and
 FilCreTmeSet(), can be called directly after DirFilLst() 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: FilCreDteGet() / FilCreDteSet() FilCreTmeGet() / FilCreTmeSet() FilOwnIDGet() / FilOwnIDSet()

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