PLCnext API Documentation 25.0.2.69
|
API to manage and manipulate single files. More...
#include <File.hpp>
Static Public Member Functions | |
static bool | Exists (const String &path) |
Checks for existence of a file. More... | |
static void | Delete (const String &path) |
Deletes the file from the filesystem. After successful operation, the synchronization of the file system will be enforced. More... | |
static void | Delete (const String &path, bool sync) |
Deletes the file from the filesystem. More... | |
static void | Copy (const String &sourcePath, const String &destinationPath, bool createDirectory=true, bool overwrite=true) |
Copies a file from source path to destination path. After successful operation, the synchronization of the file system will be enforced. More... | |
static void | Copy (const String &sourcePath, const String &destinationPath, bool createDirectory, bool overwrite, bool sync) |
Copies a file from source path to destination path. More... | |
static void | Move (const String &sourcePath, const String &destinationPath, bool createDirectory=true, bool overwrite=true) |
Moves a file from source path to destination path. After successful operation, the synchronization of the file system will be enforced. More... | |
static void | Move (const String &sourcePath, const String &destinationPath, bool createDirectory, bool overwrite, bool sync) |
Moves a file from source path to destination path. More... | |
static std::vector< byte > | ReadAll (const String &path) |
Reads data from file and returns it as byte array. More... | |
static void | WriteAll (const String &path, const std::vector< byte > &data) |
Writes the data in data into file identified by path . After successful operation, the synchronization of the file system will be forced. More... | |
static void | WriteAll (const String &path, const std::vector< byte > &data, bool sync) |
Writes the data in data into file identified by path . More... | |
static void | SyncAll (void) |
Force global file system synchronization. | |
static void | Sync (const String &path) |
Force file system synchronization for the given file. More... | |
API to manage and manipulate single files.
|
static |
Copies a file from source path to destination path.
sourcePath | Fully qualified path of file which should be copied. |
destinationPath | Fully qualified path to destination of copied file. If the path contains a filename the copied file will also be renamed. |
createDirectory | Set to true if destinationPath does not exist and should be created during copy. |
overwrite | If set to true and destinationPath already exists, it will be overwritten. |
sync | If set to true , the synchronization of the file system is enforced after successful operation. |
Arp::System::Commons::Io::AlreadyExistsException | if destinationPath already exists and overwrite is set to false |
Arp::System::Commons::Io::NotExistException | if createDirectory is set to false but the destination directory does not exists. |
Arp::System::Commons::Io::AccessDeniedException | if the process does not have write permission at destinationPath |
|
static |
Copies a file from source path to destination path. After successful operation, the synchronization of the file system will be enforced.
sourcePath | Fully qualified path of file which should be copied. |
destinationPath | Fully qualified path to destination of copied file. If the path contains a filename the copied file will also be renamed. |
createDirectory | Set to true if destinationPath does not exist and should be created during copy. |
overwrite | If set to true and destinationPath already exists, it will be overwritten. |
Arp::System::Commons::Io::AlreadyExistsException | if destinationPath already exists and overwrite is set to false |
Arp::System::Commons::Io::NotExistException | if createDirectory is set to false but the destination directory does not exists. |
Arp::System::Commons::Io::AccessDeniedException | if the process does not have write permission at destinationPath |
|
static |
Deletes the file from the filesystem. After successful operation, the synchronization of the file system will be enforced.
path | Fully qualified path of file. |
Arp::System::Commons::Io::AccessDeniedException | if process does not have permission to delete the file. |
Arp::System::Commons::Io::NotExistException | if the file does not exists. |
|
static |
Deletes the file from the filesystem.
path | Fully qualified path of file. |
sync | If set to true , the synchronization of the file system is enforced after successful operation. |
Arp::System::Commons::Io::AccessDeniedException | if process does not have permission to delete the file. |
Arp::System::Commons::Io::NotExistException | if the file does not exists. |
|
static |
Checks for existence of a file.
path | Fully qualified path of file. |
path
exists, otherwise false is returned.
|
static |
Moves a file from source path to destination path.
sourcePath | Fully qualified path of file which should be moved. |
destinationPath | Fully qualified path to destination of copied file. If the path contains a filename the moved file will also be renamed. |
createDirectory | Set to true if destinationPath does not exist and should be created during move. |
overwrite | If set to true and destinationPath already exists, it will be overwritten. |
sync | If set to true , the synchronization of the file system is enforced after successful operation. |
Arp::System::Commons::Io::AlreadyExistsException | if destinationPath already exists and overwrite is set to false |
Arp::System::Commons::Io::NotExistException | if createDirectory is set to false but the destination directory does not exists. |
Arp::System::Commons::Io::AccessDeniedException | if the process does not have write permission at destinationPath or sourcePath . |
|
static |
Moves a file from source path to destination path. After successful operation, the synchronization of the file system will be enforced.
sourcePath | Fully qualified path of file which should be moved. |
destinationPath | Fully qualified path to destination of copied file. If the path contains a filename the moved file will also be renamed. |
createDirectory | Set to true if destinationPath does not exist and should be created during move. |
overwrite | If set to true and destinationPath already exists, it will be overwritten. |
Arp::System::Commons::Io::AlreadyExistsException | if destinationPath already exists and overwrite is set to false |
Arp::System::Commons::Io::NotExistException | if createDirectory is set to false but the destination directory does not exists. |
Arp::System::Commons::Io::AccessDeniedException | if the process does not have write permission at destinationPath or sourcePath . |
|
static |
Reads data from file and returns it as byte array.
path | Fully qualified path to file to be read. |
|
static |
Force file system synchronization for the given file.
path | Path to the file to be synchronized. |
|
static |
Writes the data in data
into file identified by path
. After successful operation, the synchronization of the file system will be forced.
path | Fully qualified path to file to write to. |
data | Vector of bytes that should be written into file path . |
|
static |
Writes the data in data
into file identified by path
.
path | Fully qualified path to file to write to. |
data | Vector of bytes that should be written into file path . |
sync | If set to true , the synchronization of the file system is enforced after successful operation. |