#include <rename.h>
Public Member Functions | |
virtual | ~undo_item_rename () |
undo_item_rename (const nstring &oldpath, const nstring &newpath) | |
bool | operator== (const undo_item_rename &rhs) const |
void | action () |
void | unfinished () |
Private Member Functions | |
undo_item_rename () | |
undo_item_rename (const undo_item_rename &) | |
undo_item_rename & | operator= (const undo_item_rename &) |
Private Attributes | |
nstring | oldpath |
nstring | newpath |
It renames a file, moving it between directories if required.
Any other hard links to the file (as created using link(2)) are unaffected.
If newpath already exists it will be atomically replaced (subject to a few conditions), so that there is no point at which another process attempting to access newpath will find it missing.
If newpath exists but the operation fails for some reason rename guarantees to leave an instance of newpath in place.
However, when overwriting there will probably be a window in which both oldpath and newpath refer to the file being renamed.
If oldpath refers to a symbolic link the link is renamed; if newpath refers to a symbolic link the link will be overwritten.
Definition at line 48 of file rename.h.
virtual undo_item_rename::~undo_item_rename | ( | ) | [virtual] |
The destructor.
The constructor.
oldpath | What the file is called now. | |
newpath | What the file will be called then. |
undo_item_rename::undo_item_rename | ( | ) | [private] |
The default constructor. Do not use.
undo_item_rename::undo_item_rename | ( | const undo_item_rename & | ) | [private] |
The copy constructor. Do not use.
bool undo_item_rename::operator== | ( | const undo_item_rename & | rhs | ) | const [inline] |
void undo_item_rename::action | ( | ) | [virtual] |
The action method is used to perform the undo action.
Implements undo_item.
void undo_item_rename::unfinished | ( | ) | [virtual] |
The unfinished method is used to print a warning about unfinished undo action. This happens when there is an undo error. The default action says nothing.
Implements undo_item.
undo_item_rename& undo_item_rename::operator= | ( | const undo_item_rename & | ) | [private] |
The assignment operator. Do not use.
nstring undo_item_rename::oldpath [private] |
nstring undo_item_rename::newpath [private] |