RPCEmu (HostFS?) can't change the type of an open file
Rick Murray (539) 13840 posts |
As evidenced by the following code:
Works as expected on “real” RISC OS. ;-) |
Steve Pampling (1551) 8170 posts |
er, yeah. Windows users think it is normal. So our inout is? |
André Timmermans (100) 655 posts |
IIRC HostFS when setting a filetype renames the file on the host to “filename,type” and so will fail while the file is open. I find that “feature” of HostFS real annoying as you can’t use the same files on both sides (PC and emulation) without setting its filetype or stripping the “,type” from the filename everytime you wish to use it on the other side. I would far more prefer to keep the RISC OS stuff (applications, Boot, etc) on a disc image and have a LanManFS like filer that translates the host file’s extension into a filetype with the help of the Mimemap module. |
Rick Murray (539) 13840 posts |
Alternatively, could HostFS not be set to map files to a dot-something instead of comma-something? IIRC, you could set your own preferred extensions under RedSquirrel. Steve – given that Windows just recently and randomly trashed the boot sector, primary FAT, etc of a microSD card ( details ), I don’t have much to say about Microsoft and filesystems right now. O’course, as HostFS is an arbitration layer between Windows and RISC OS, why can’t it close the file, rename it, and then reopen it? It knows the file handle, path, access mode, and current pointer. And surely the RISC OS handle is an abstraction from the Windows handle so changing that shouldn’t affect RISC OS? Another (minor) quirk – renaming a text file to “blah/txt” under RISC OS, or sometimes trying to strip a “/xxx” tail, results in an error that is essentially telling you that a file can’t be renamed to itself; so it looks like there is an “issue” between what the file is physically and what is presented to RISC OS. ;) Workaround? Rename to something totally different, then rename to that which was desired in the first place. |
nemo (145) 2546 posts |
RedSquirrel and VirtualRPC’s HostFS has a Windows-side extension/filetype mapping that allows it to use Windows extensions where appropriate (though I’m not sure that .oby is particularly useful “out there”). Having said that, it’s far from perfect. For example, it imposes a ,FFF or .txt on ANY file shift-loaded into an editor, which is simply a bug, and its grokking of extension/filetype means certain things don’t work the way you’d want them to. eg: example.txt example.tif example.png Good luck with those. Sadly it also means that bunzip’s filename munging doesn’t work AT ALL, since these all map to the same RISC OS filename: somearchive.tar.bz somearchive.tar somearchive.zip somearchive A stable and reliable HostFS would be a beautiful thing! BTW, Graeme’s HostFS is also guilty of the heinous crime of passing every BPut and BGet over the emulated podule interface to the Windows side, which makes it orders of magnitude slower than it should be. I forget the metrics, but it’s dreadfully slow for byte transfers. |