List of functions, reference example:
https://github.com/aoyiduo/woterm/blob/main/private/playbooks/test/TestLocalFile.qml
- bool rename(const QString& fileSrc, const QString& fileDst);
Rename file. - bool exist(const QString& path) const;
Check if the file exists. - void close();
Close file operation. - bool open(const QString& path, bool readOnly);
After opening the file and returning success, the read/write/seek operation can be executed. - QByteArray read(int size);
Reads the file content at the specified size. - bool write(const QByteArray& buf);
write to file. - bool seek(qint64 pos);
Set the current file operation progress to the specified location. - qint64 fileSize() const;
Returns the file size. - FileError error() const;
Reason for operation failure. - QString errorString() const;
Returns the reason for the operation failure in string mode.