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

LocalDir component

List of functions, refer to examples: https://github.com/aoyiduo/woterm/blob/main/private/playbooks/test/TestLocalDir.qml

QString downloadLocation() const;
Obtain the save path for system file downloads.

QString picturesLocation() const;
Obtain the image save path.

QString appConfigLocation() const;
Obtain the application configuration path.

QString appDataLocation() const;
Obtain the application data path.

QString homeLocation() const;
Obtain the user’s home path

QString tempLocation() const;
Get temporary file path.

QVariantList entryInfoList(const QString& path = QString()) const;
Obtain a list of all files in the specified path.

QString absoluteFilePath(const QString& path) const;
Obtain the absolute path of the file.

QString cleanPath(const QString& path) const;
Format the path.

QString toNativeSeparators(const QString& path) const;
Convert the separators in the path into symbols for the operating system. If in window, all [/] symbols will be modified to [\], while in Linux, [\] will be modified to [/].

QVariantMap fileInfo(const QString& path) const;
Obtain file details for the specified path. The content returned is as follows:
>>path: The absolute folder path where the file is located.
>>fileName: file name
>>filePath: The absolute path of the file.
>>isDir: Is it a folder.
>>isRoot: Is it the root directory.
>>isFile: Is it a file.
>>size: file size.
>>permissions: The file permissions, in the format of Linux permissions, are consistent in Text mode: for example [drwxr-xr-x]
>>canRead: readable?
>>canExecute: executable?

bool makePath(const QString& path);
Create a folder that supports multi-layer file creation, similar to the Linux command: mkdir – p xxx/xx//xx/xx

bool exist(const QString& path);
Check if the specified path exists.

bool rename(const QString& pathSrc, const QString& pathDst);
Move the source file to a new path and rename it.