Can a Loader
get info from the FileSystem
such as the file's metadata?
#7355
-
When making For older systems like I'm working with in RetroGhidra it's very common that the file itself has little or no structure but the disk or archive format the file comes from does have useful extra info such as file type, load address, entry point, etc. In most modern systems I know much about, files are pretty self-contained. Sometimes just knowing the filename extension is all the extra info you need in addition to info in the file's header, which is known to exist due to a magid number or signature. But maybe some modern formats also have useful info stored outside the raw files themselves? In a But a Maybe I'm missing a way to get the "file" associated with a If not, which is what I suspect, how possible would it be to add a way to do this? What is missing that would need to be designed and implemented? I understand it might not be worthwhile if it doesn't already exist, it would be difficult to implement, and no modern files require it.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Typing that all out helped me think about this more clearly, which led me to find this much already:
I'm now looking if I can get from an OK I can then do String path = fsrl.getPath();
FSRLRoot fsroot = fsrl.getFS();
FileSystemService fss = FileSystemService.getInstance();
FileSystemRef fsref = fss.getFilesystem(fsroot, null);
GFileSystem gfs = fsref.getFilesystem();
GFile file = gfs.lookup(path); But to get the metadata for the |
Beta Was this translation helpful? Give feedback.
-
Here are some samples.
|
Beta Was this translation helpful? Give feedback.
Your code is workable, but as pasted above would leak reference handles to the file system instance and prevent orderly closing of the file system.
If you wanted the 'correct' way, I would say something like (completely untested):