updating oE rename_file

rename_file

include filesys.e 
namespace filesys 
public function rename_file(sequence old_name, sequence new_name, integer overwrite = 0) 

rename a file.

Parameters:
  1. old_name : a sequence, the name of the file or directory to rename.
  2. new_name : a sequence, the new name for the renamed file
  3. overwrite : an integer, 0 (the default) to prevent renaming if destination file exists, 1 to delete existing destination file first
Returns:

An integer, 0 on failure, 1 on success.

Comments:
  • If new_name contains a path specification, this is equivalent to moving the file, as well as possibly changing its name. However, the path must be on the same drive for this to work.
  • If overwrite was requested but the rename fails, any existing destination file is preserved.
See Also:

move_file copy_file

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu