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

 Syntax:
 lpszDirName = DirSubDirLst(lpszFileSpec, lpszNewName)

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

 Returns:
 A character value.

 Description:
 DirSubDirLst() is used to obtain a list of sub-directory names based on
 the criteria specified by lpszFileSpec.

 To return a list of directories, DirSubDirLst() should be called once with
 parameter lpszFileSpec, and then repeatedly with lpszFileSpec passed as a
 NULL string ("") until an empty string is returned signifying the end of
 the list.

 lpszFileSpec must be the full path of the parent directory including the
 volume name and the criteria of the subdirectories to be searched. The
 wildcards "*" and "?" can be used, e.g. to return a list of all
 subdirectories under SYS:DATA, lpszFileSpec would be "SYS:DATA\*", or to
 return all sub directories beginning with WP, "SYS:DATA\WP*".

 To change the name of a directory, lpszFileSpec must contain the full
 directory path including the name of the directory to be changed.
 lpszNewName must contain just the new name for the directory, WITHOUT the
 path. DirSubDirLst() will then return the new name of the directory. 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 directories under "SYS:DATA" and their
 // creation details:

 lpszNameStr = DirSubDirLst( "SYS:DATA\*","" )
 do while !empty( lpszNameStr )
    ? lpszNameStr
    ?? DirCreDteGet(),DirCreTmeGet(), DirOwnIDGet()
    lpszNameStr = DirSubDirLst("","")
 enddo

 // To change the name of directory SYS:DATA\KATIE to SYS:DATA\JOHN:

 lpszNameStr = DirSubDirLst( "SYS:DATA\KATIE", "JOHN" )
 if( !empty( lpszNameStr ) )
    ? "The directory's name is now", lpszNameStr
 endif

 Notes:
 Other functions prefixed with Dir, such as DirCreDteGet(),
 DirCreTmeGet() and DirOwnIDGet(), can be called directly after
 DirSubDirLst() as shown above to return further information about the
 directory.

 If an empty string is returned, check NWErrorGet().
 Appropriate trustee access rights are required to use this function.

See Also: DirCreDteGet() / DirCreDteSet() DirCreTmeGet() / DirCreTmeSet() DirOwnIDGet() / DirOwnIDSet()

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