Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- libc - <b>_rename</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
_rename
=======

Syntax
------

     #include <stdio.h>
     
     int _rename(const char *oldname, const char *newname);

Description
-----------

This function renames an existing file or directory OLDNAME to NEWNAME.
It is much smaller that `rename' (rename:.), but it can only   
rename a directory so it stays under the same perent, it cannot move
directories between different branches of the directory tree.  This
means that in the following example, the first call will succeed, while
the second will fail:

     _rename("c:/path1/mydir", "c:/path1/yourdir");
     _rename("c:/path1/mydir", "c:/path2");

On systems that support long filenames (_use_lfn:.), `_rename'   
can also move directories (so that both calls in the above example
succeed there), unless the `LFN' environment variable is set to `n', or
the `_CRT0_FLAG_NO_LFN' is set in the `_crt0_startup_flags' variable,
_crt0_startup_flags:.   

If you don't need the extra functionality offered by `rename' (which
usually is only expected by Unix-born programs), you can use `_rename'
instead and thus make your program a lot smaller.

Return Value
------------

Zero on success, nonzero on failure.


See Also: rename _use_lfn _crt0_startup_flags

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