XD2031 icon indicating copy to clipboard operation
XD2031 copied to clipboard

fs provider for directory complains about files that are not actually in the directory

Open snhirsch opened this issue 4 years ago • 3 comments

If I assign a directory named 'os9' as a provider it seems to work fine. If the directory is named anything else, I get complaints about being unable to stat a file (os9 drive b) that simply does not exist.

snhirsch avatar Sep 11 '20 14:09 snhirsch

Update: After poking around under a debugger I figured out what was happening. I specify the assign as -A0:fs=/home/hirsch/test Rather than directly looking for an object named 'test' under my home directory, it scans the entire directory and tries to stat everything in it. One of the objects was a dangling symlink to 'OS9 DRIVE B', so stat() fails at that point and the scan gives up with an error - but rather than terminating it leaves the program running with nothing assigned! It seems to me that if an object is specified the program should simply try to stat that particular object.

I don't understand the rationale behind the directory scan.

snhirsch avatar Sep 11 '20 15:09 snhirsch

The reason the scanning is done is that the algorithm tries to navigate into P00 files as well as D64 and other files. Unfortunately P00 files can have a CBM name inside that does not at all match the host's filename, so it has to be read and looked into.

For example you can scan into a D80 disk image (as a directory), then have a D64 file as directory in it, and a P00 file in that one. Ok, maybe that's a bit crazy, but should work.

But yes, the algorithm could be optimized.

fachat avatar Sep 11 '20 21:09 fachat

Thanks. I understand why you need to check files, but it might be better to first determine if the specified object is a directory and, if so, restrict the scan to the files within it. But perhaps I'm not grasping your vision for on disk organization.

snhirsch avatar Sep 12 '20 02:09 snhirsch