Closed aaron-bigadventurecrew closed 5 days ago
@aaron-bigadventurecrew see this PR #98238
@syntaxerror247 That PR encapsulates the need well, this issue can be closed once merged. My intention of raising the issue was to give a simple MRP for the team's review anyways since explaining it can be a bit much. Thank you!
Still pending the live docs page to be updated reflecting the PR Merge:
Clear browser cache (Ctrl+Shift+R):
Request URL:
https://docs.godotengine.org/en/stable/classes/class_fileaccess.html
Request Method:
GET
Status Code:
200 OK
Referrer Policy:
strict-origin-when-cross-origin
access-control-allow-methods:
HEAD, OPTIONS, GET
access-control-allow-origin:
*
age:
6402
cache-control:
max-age=1200
cdn-cache-control:
public
cf-cache-status:
DYNAMIC
content-encoding:
zstd
content-type:
text/html; charset=utf-8
date:
Wed, 16 Oct 2024 20:08:51 GMT
last-modified:
Fri, 04 Oct 2024 03:31:29 GMT
Follow-up normal refresh:
Request URL:
https://docs.godotengine.org/en/stable/classes/class_fileaccess.html
Request Method:
GET
Status Code:
304 Not Modified
Referrer Policy:
strict-origin-when-cross-origin
access-control-allow-methods:
HEAD, OPTIONS, GET
access-control-allow-origin:
*
age:
6615
cache-control:
max-age=1200
cdn-cache-control:
public
cf-cache-status:
DYNAMIC
date:
Wed, 16 Oct 2024 20:12:24 GMT
etag:
W/"fefc62705638391dc44bb2e0341f4c50"
last-modified:
Fri, 04 Oct 2024 03:31:29 GMT
Still pending the live docs page to be updated reflecting the PR Merge:
This is a link to the stable
docs, it will only be updated when PR is cherry-picked for 4.3, new changes are applied to the latest
docs. But sync class reference
GitHub action is set to only run every Saturday, so latest
docs won't be updated until then.
@bruvzg Oh ok sounds good then! You can mark this as resolved whenever you'd like, the changes to the wording in the PR make sense to me and explain why my reported behavior happened.
Tested versions
Reproducible since 4.3-beta3 up until now 4.4-dev3
System information
Windows 10 Pro - Godot v4.3.stable.steam [77dcf97d8]
Issue description
Per the docs, FileAccess' store_line() method is defined as:
The use of Appends here would imply that it would just add to a file ending with a trailing \n. However, the use of WRITE, WRITE_READ, and READ_WRITE cause the file to be overwritten completely. The only way to truly append a file with
store_line()
is to use theseek_end()
method first.The Ask: Either (1) Update the docs to more accurately explain what
store_line()
does, or (2) Revisit the engine code forstore_line()
and confirm whether it should actually append to a file.Docs Link: https://docs.godotengine.org/en/stable/classes/class_fileaccess.html#class-fileaccess-method-store-line
Steps to reproduce
Note the following
print()
outputs:This shows
store_line()
does end with a trailing \n, but even in READ_WRITE it overwrites the file without the use ofseek_end()
first.Minimal reproduction project (MRP)
MRP made in v4.3.stable.steam:
StoreLineRepro.zip