1. Home
  2. Docs
  3. Manual
  4. Playbook
  5. Command list
  6. LocalFile component

LocalFile component

List of functions, reference example:

  • 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.