Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions automated_updates_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
{
"date": "2026-07-07",
"summary": "Improved keyboard docs: added 'Key just pressed' (held vs one-frame) and 'Any key released' conditions, control-remapping note, and a reference list of valid key names"
},
{
"date": "2026-08-08",
"summary": "Improved file system docs (added Read a directory action, normalize option, and executable-file/home/directory/file-name/extension expressions) and screenshot docs (platform limitation and automatic .png extension)"
}
]
}
23 changes: 23 additions & 0 deletions docs/gdevelop5/all-features/filesystem/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,19 @@ It is advised to use the expressions for special folders (see below) to keep you

** (Optional) Result variable: ** Variable to store the result. It can either hold the value 'ok': the task was successful or 'error': an error occurred. The variable will be updated, at the moment the file operation has finished.

---

#### Read a directory
This action reads the contents of a directory (all files and sub-directories) and stores their names into a scene variable.
== Parameters ==
** Directory path: ** The absolute path to the directory to read.

** Variable to store the result: ** The scene variable that will receive the result. It is set to an array containing the name of every file and sub-directory found in the directory, or to `"error"` if the directory could not be read.

!!! note

The load actions above have an optional **"Normalize the file content"** parameter (enabled by default). It replaces Windows new line characters ("CRLF") by a single new line character so that loaded text behaves the same on every operating system.

## Expressions
These expressions return the path to special folders on the users' operating system. If you use these expressions for loading and saving files it will be guaranteed to work on all supported operating systems. (Currently Windows, Linux, and macOS)
!!! tip
Expand All @@ -204,6 +217,10 @@ This expression returns the operating system independent path to the _Documents_
This is the standard folder for storing documents.
#### This games executable folder
This expression returns the operating system independent path to the folder where your game is being executed from.
#### Game executable file
This expression returns the operating system independent path to your game's executable file itself (not just its folder).
#### User's Home folder
This expression returns the operating system independent path to the current user's home folder (for example `C:\Users\Name` on Windows).
#### Pictures folder
This expression returns the operating system independent path to the _Pictures_ folder of the user that runs your game.
This is the standard folder for storing images.
Expand All @@ -216,6 +233,12 @@ This folder is used for storing application settings.
#### Path delimiter
This expression returns the operating system independent path delimiter character. ("\" on Windows and "/" on Linux and macOS).
Use this expression to build cross-platform file paths that can be accessed on all supported operating systems.
#### Get directory name from a path
This expression returns the portion of a path that represents the directories, without the ending file name. It is useful to extract the containing folder of a file.
#### Get file name from a path
This expression returns the name of the file (with its extension, if any) from a full path.
#### Get the extension from a file path
This expression returns the extension of the file designated by the given path, including the period (for example `.txt`).

## Example
In order to save a screenshot to the _Pictures_ directory you could write:
Expand Down
6 changes: 6 additions & 0 deletions docs/gdevelop5/all-features/screenshot/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ title: Screenshot extension

This extension lets you save a screenshot of the running game in a specified folder.

!!! warning

Taking a screenshot only works when the game runs on Windows, Linux or macOS (games exported with Electron). It has no effect in web games or in mobile games, because browsers and mobile apps are not allowed to write files directly to the file system.

Note: As of GDevelop 5.0.0-beta92 the screenshot action is no longer an extension. Just add an action and search for `screenshot` or go to `Other Actions`/`Screenshot`/`Take screenshot`.

### Actions
Expand All @@ -21,6 +25,8 @@ The save path needs to be an absolute path on the file system (Like "C:\MyFolder

Relative paths are not supported.

If the save path does not already end with `.png`, the extension appends it automatically. The screenshot is always saved as a PNG image.

!!! note

In order to create a game that runs on all supported platforms you should use the special folders from the file system extension in combination with the path separator. These determine the path to common folders like *Pictures*, *Documents* or *Desktop* automatically. You can read more about it in [this article](/gdevelop5/all-features/filesystem).
Expand Down