Skip to content

[rcore] Fix FileMove from delete file if FileCopy did not work#5806

Merged
raysan5 merged 1 commit intoraysan5:masterfrom
Lucrecious:master
Apr 26, 2026
Merged

[rcore] Fix FileMove from delete file if FileCopy did not work#5806
raysan5 merged 1 commit intoraysan5:masterfrom
Lucrecious:master

Conversation

@Lucrecious
Copy link
Copy Markdown
Contributor

@Lucrecious Lucrecious commented Apr 26, 2026

Hello!

I was making a file browser in my favourite graphics library (raylib), and needed file move functionality.

The issue was that despite the function running and leaving no errors, it was deleting my file instead of moving it!

I noticed that FileCopy seems to return 1 if SaveFileData returns true and 0 otherwise, but some other FileX functions return 0 if the operation succeeds - so I wasn't sure what to fix!

  1. Is FileCopy supposed return 0 if it succeeds or
  2. is the intended functionality for it to return 1 for success but the bug is in FileMove?

Anyway, I went with the solution that preserves backwards compatibility and assumes that FileCopy cannot change what it returns until... 7.0?

@Lucrecious Lucrecious changed the title Fix FileMove from delete file if FileCopy did not work [rcore] Fix FileMove from delete file if FileCopy did not work Apr 26, 2026
@raysan5 raysan5 merged commit dff07d0 into raysan5:master Apr 26, 2026
@raysan5
Copy link
Copy Markdown
Owner

raysan5 commented Apr 26, 2026

@Lucrecious Wow! Good catch! It will be updated for new release 6.1 or 6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants