[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _fsRename()
 Rename a file
------------------------------------------------------------------------------
 C Prototype

     #include "filesys.api"
     void _fsRename(
                          BYTEP fpOldName,
                          BYTEP fpNewName
                      )

 Arguments

     fpOldName is the current name of the file.

     fpNewName is the new name for the file.

 Returns

     _fsRename() has no return value.

 Description

     This function renames the file, fpOldName, to the new name, fpNewName.
     This function is equivalent to the CA-Clipper function FRENAME().  If an
     error occurs, _fsError() will return the number of the error.

 Examples

     .  The following code fragment illustrates the use of
        _fsRename().  Note that error handling is important when renaming a
        file as the function can fail for a number of reasons:

        #include "filesys.api"
        .
        .
        .
        _fsRename( "Foo", "Temp" );

        // Always check for errors when renaming a file
        if (_fsError() )
        {
           // Report the error condition
        }

 Files  Library is CLIPPER.LIB, header file is Filesys.api.


See Also: _fsDelete() _fsError()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson