Closed silverdr closed 2 years ago
Hi @silverdr and happy to see you again. Which version are you using ? I tried with the latest one and have no issue.
I checked the line of code that generated the problem: it get the parent directory of the selected file; sometimes happens that, depending on the OS, this directory is not retrivied and JDK returns null. Can you send me the path of the selected file ?
Please, can you try with the same file on a different directory ?
Bye
Alessandro, I apologise for not mentioning the version, I obviously tried the latest released one:
https://github.com/abbruzze/kernal64/releases/tag/v1.7.3b4
Full path to the disk image file is:
/Users/silverdr/sources/silverdr/64er_sources/jema_n_silver/jema_n_silver.d64
and I start k64.sh with:
/Applications/local/emu/kernal64/k64.sh --warponload --beam-racer-enabled --drive8-file jema_n_silver.d64 --run-file jema_n_silver.c64
When I move up one level and start with:
/Applications/local/emu/kernal64/k64.sh --warponload --beam-racer-enabled --drive8-file jema_n_silver/jema_n_silver.d64 --run-file jema_n_silver.c64
The exception is in fact NOT thrown
Ok, don't why but seems an OS's filesystem related issue.
Hey, if you have new BeamRacer demo, please, send me a preview!
Hm, there are no fancy characters in the path, not even spaces… regular POSIX stuff works normally. Can't say what that could be. Right, I am trying to build a small demo. Shall remember to send you! ;-)
FWIW - I don't think this is a filesystem issue. As I mentioned all regular POSIX stuff works on that filesystem, but a wild guess... I didn't check your sources on that but might it be that whatever method you use there does not utilise any POSIX functions for filesystem traversal but rather decomposes the path string? In such case that could explain the behaviour where there's more than one path component, then the parent is not null but if there's only one (the actual filename) then there's no parent there.. does this make any sense? ;-)
I just confirmed - I am getting the same exception thrown on two different OS/filesystem combinations. Whether Macos and APFS or GNU/Linux and ext4fs the exception is there.
I got it: the problem arises when you specify a file relative to the current directory (without any path). Unfortunately, the Java API File.getParentFile returns null in this case. A stupid workaround is to prefix it with ./ I will check this case and force the prefix on the filename.
Actually I can do relative path spec. My guess is what I mentioned above - that the path string is decomposed to get whatever is before the filename. If you add "something" like ./
or ../parent_dir/
then it gets "something" and returns it instead of nil. Glad to be able to help :-)
When attaching disk image with
--drive8-file diskimage.d64
an exception is thrown (even thought the image seems to get attached correctly):