Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
The file system, offered by HUAWEI Quick Game, offers storage isolated by game and user, along with a suite of management API. The global object qg provides access to the globally unique file system manager. All file system management operations are handled through qg, specifically via the qg.getFileSystemManager() API.
The files are classified into two types:
Local files can also be classified into two types:
Due to the size limitation, a code package should only include files for initial loading, rather than large files or files in dynamic replacement. You are advised to download large files or files in dynamic replacement by API and save them as local files after the quick game is launched.
A code package file path complies with the following requirements:
Local files are saved in an isolated storage space that is allocated after a quick game is loaded. They are identified by HUAWEI ID. That is to say, files are isolated by both account and game. Users cannot access data from other HUAWEI IDs on the same device, nor can they access files across different games.

Local temporary files can be created only by calling specific APIs and are not editable. They are only accessible during the session they were created and will become unavailable once the game is re-launched. Therefore, please do not save a local temporary file path for future use. If a local temporary file is required for future use, you can call FileSystemManager.saveFile() or FileSystemManager.copyFile() to convert it into a local user file.
HUAWEI Quick Game provides a user file directory for you, and you have full read and write permissions on the directory. You can obtain the path of the directory by calling qg.env.USER_DATA_PATH.
| File Type | Readable | Writable |
|---|---|---|
| Code package files | Yes | No |
| Local temporary files | Yes | No |
| Local user files | Yes | Yes |
- const fs = qg.getFileSystemManager();
- fs.writeFile({
- filePath: `${qg.env.USER_DATA_PATH}/${fileName}`,
- data: "Hello world",
- encoding: "utf8",
- success: successCb,
- fail: failCb
- });