godotengine / godotengine/godot-docs
Clarify return behavior and format for `FileAccess.get_path()` in class reference
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
**Your Godot version:**
4.2.2.stable.official
**Issue description:**
The documentation for FileAccess.get_path() currently states only:
Returns the path as a string.
This is vague compared to other FileAccess methods like get_open_error() or get_length(), which include detailed notes on return values and behavior under edge cases. It is not clear:
Whether the path returned is absolute, relative, or virtual (e.g., res://, user://)
What is returned if no file has been opened yet
Whether it can return an empty string, null, or throw an error
This ambiguity can lead to confusion and unnecessary guesswork when developers interact with the file system API.
**URL to the documentation page (if already existing):**
https://docs.godotengine.org/en/stable/classes/class_fileaccess.html#class-fileaccess-method-get-path
Suggested improvement:
Clarify the following in the method description:
Return value when no file is open
Expected path format (absolute, virtual, etc.)
Example usage if applicable
This would align with the Godot Documentation Style Guide and improve consistency across the FileAccess API reference.
I’ve checked the Godot docs issues and didn’t see a similar request already posted. Happy to submit a pull request for this once approved or discussed.
Contributor guide
No contributing guide indexed for this repository
Research direction
Read the FileAccess.get_path() reference at the linked documentation URL and compare nearby get_open_error() and get_length() descriptions. Verify the no-open-file result and path format from the documented API behavior, then update the method description with those facts and an example if supported; done when the return behavior is explicit and consistent with the surrounding FileAccess API documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- godot
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100