Skip to content
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

[Feature Request] SceIoStat functions #47

Open
bb010g opened this issue Jun 15, 2020 · 5 comments
Open

[Feature Request] SceIoStat functions #47

bb010g opened this issue Jun 15, 2020 · 5 comments

Comments

@bb010g
Copy link

bb010g commented Jun 15, 2020

Functions that deal with file status (declared in VitaSDK's File Status Library, <psp2/io/stat.h>) are not exposed by LPP, specifically the functions dealing with SceIoStat: sceIoGetstat(), sceIoGetstatByFd(), sceIoChstat(), and sceIoChstatByFd(). (The ByFd variants would likely fold into LPP's handle interface, provided from functions like System.getFile).)

These functions are useful for implementing file managers at least.

@Rinnegatamante
Copy link
Owner

What fields in particular would you need from SceIoStat?

@bb010g
Copy link
Author

bb010g commented Jun 17, 2020

Ideally? All of them. st_mtime, st_ctime, & st_atime are standard file system fields, st_size is being returned anyways from this call and useful, st_mode allows for making files visible to safe homebrew via the others octet (VitaShell removed that patch's functionality and doesn't let you change file permissions), and by now st_attr is probably worth carrying through too unless it's a huge footgun to modify? st_private looks reasonable to leave out, but I also don't know what it's used for ("Device-specific data.").

There's no way to get to these currently without either writing C or figuring out LuaJIT's FFI library, which makes me uncomfortable due to hyln9/vita-libdl#1 being an open issue relating to void *symbol_lookup(char *module, char *symbol). (By the way, tossed lpp-vita's eboot_unsafe.bin.elf into Ghidra and am chasing down where https://pastebin.com/V615iLtj was coming from; see that issue.)

@Rinnegatamante
Copy link
Owner

is there an usage of sceIoChstat and/or doc about it? The only snippets i found about it are to fill an error on id.dat so that it gets regenerated.

@bb010g
Copy link
Author

bb010g commented Jun 19, 2020

There's one linked in the VitaShell commit? As for documentation, VitaSDK's Doxygen seems to cover it pretty alright; Unix's chmod(2) is also pretty similar. https://manpage.me/index.cgi?q=chmod&sektion=2&manpath=OpenBSD+6.2

@Rinnegatamante
Copy link
Owner

Partially solved with 2fafdc8

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

No branches or pull requests

2 participants