Skip to content

getWorkingDirectory: implemented to return "./" #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

jstine35
Copy link
Collaborator

It's enough to allow most things that might want to use it to work. The function should only be used for local development or debugging purposes anyway, as the concept of CWD is not portable and is not friendly to end users running program via high-level shells (eg. Windows Explorer or Finder or such).

Difference from LOVE: LOVE returns the CWD as an absolute path. Lutro returns a relative path.

I split it out from PR #260 since the latest implementation of getUserDirectory will no longer use getCurrentDirectory as a fallback. I felt it was still worthwhile to retain the work of implementing getCurrentDirectory() even if it's not directly supported by libretro API, and not recommended to use it anywhere outside of local/development contexts. I think it is still nice to have these sort of dev-friendly APIs available for use, and assume devs will use them effectively and responsibly.

*/
int fs_getWorkingDirectory(lua_State *L)
{
lua_pushstring(L, "./");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me! While Working directory isn't really a thing in libretro, I think this is a worthy workaround.

@RobLoach
Copy link
Member

Looks like a small conflict, but good!

It's enough to allow most things that might want to use it to work. The function should only be used for local development or debugging purposes anyway, as the concept of CWD is not portable and is not friendly to end users running program via high-level shells (eg. Windows Explorer or Finder or such).
@jstine35 jstine35 merged commit c1ed4f5 into libretro:master Jan 25, 2025
10 checks passed
@jstine35 jstine35 deleted the getUserDirectory branch January 25, 2025 02:25
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.

3 participants