added Poco::File::linkTo()

This commit is contained in:
Günter Obiltschnig
2017-12-14 10:35:07 +01:00
parent 9472b163b4
commit d29972ef24
12 changed files with 129 additions and 26 deletions

View File

@@ -63,6 +63,13 @@ class Foundation_API File: private FileImpl
public:
typedef FileSizeImpl FileSize;
enum LinkType
/// Type of link for linkTo().
{
LINK_HARD = 0, /// hard link
LINK_SYMBOLIC = 1 /// symbolic link
};
File();
/// Creates the file.
@@ -189,6 +196,14 @@ public:
void renameTo(const std::string& path);
/// Renames the file to the new name.
void linkTo(const std::string& path, LinkType type = LINK_SYMBOLIC) const;
/// Creates a link (symbolic or hard, depending on type argument)
/// at the given path to the file or directory.
///
/// May not be supported on all platforms.
/// Furthermore, some operating systems do not allow creating
/// hard links to directories.
void remove(bool recursive = false);
/// Deletes the file. If recursive is true and the
/// file is a directory, recursively deletes all