I get errors like : the image must be on a host or local drive
What does IMGMOUNT do differently in memory? vs a mounting a drive letter? Not really wanting help with a problem, but a better explanation, if possible ...
Suggestion : Maybe tell the user to mount the image in a local drive path -- The Specified drive letter must be mounted to access the image file ... Related Curiosity? --How is this specified by physical hardware
I get errors like : the image must be on a host or local drive
What does IMGMOUNT do differently in memory? vs a mounting a drive letter? Not really wanting help with a problem, but a better explanation, if possible ...
Suggestion : Maybe tell the user to mount the image in a local drive path -- The Specified drive letter must be mounted to access the image file ... Related Curiosity? --How is this specified by physical hardware
I'm not an expert in this area, but since nobody else has answered this, I'm going to post my theory...
I think that the problem is that the MOUNT and IMGMOUNT commands are "outside" of the DOS environment. They work with real directories to set the emulated directories for DOS to use. So while DOS thinks it's in the D: drive, the IMGMOUNT command is still in whatever the real current directory is.
Kind of like how if you run an emulator and you configure a real controller, the emulator itself is completely oblivious to any control changes a game might let you make. A game might let you remap the buttons, but when you go back to the emulator's configuration, it will still be the same, because the configuration sits outside the emulated system.
I've not looked into this in detail, but "mount"ing an local directory-tree is a completely different function that "imgmount"ing an actual drive image.
When you "mount" a directory tree, DosBox has to track the part and convert local file operations into host file operations. It doesn't see the actual storage of the filesystem.
Imgmount on the other hand just provides BIOS access to sectors within the image. This is just a binary file to the host which knows nothing about files within it!
The actual FAT implementation of the file system has to be done within DosBox (which sometimes has problems - I've had file operations fail on IMGMOUNTed drives - this is the main reason I created my "FDI" (FloppyDiskImage) tool to create and manipulate floppy disks images and files within them directly)
One place you can see this is "SUBST" on a local MOUNTed drive, SUBST just creates a new mount to a different point on the original MOUNT path.
... but ... SUBST doesn't work on an IMGMOUNTed drive - it doesn't have to smarts to redirect an access point to a new directory junction.
One place I effectively use IMGMOUNTed drives a lot is by BOOTing a floppy drive image.
DOSBOX BIOS correctly provides access to 512 byte (sector sized) "chunks" in that image, and a BOOTed DOS will run and access it's file system as normal (in this case the FAT implementation is being done by the booted DOS)
I have no idea why IMGMOUNT couldn't work on on a image mounted over the network. You can still read/write/seek in such an image, which is all you would need to access virtual sectors (a bit slower perhaps - but it should still work)
https://dunfield.themindfactory.com ; "Daves Old Computers" ; SW dev addict best known:
ImageDisk: rd/wr ANY floppy PChw can ; Micro-C: compiler for DOS+ManySmallCPU ; DDLINK: simple/small filetransfer(w/o netSW)via Lan/Lpt/Com
It's because you're using quotes to access a file on a mounted drive. You can't do that - either use quotes to specify the full path name on the host ("c:\images\70mb.img"), or use the filename that "dir" shows with no quotes.
It's because you're using quotes to access a file on a mounted drive. You can't do that - either use quotes to specify the full path name on the host ("c:\images\70mb.img"), or use the filename that "dir" shows with no quotes.
I don't think that's it....
Like "mount", "imgmount" is referencing files/locations directly on the host which may have spaces in the names, so quotes make sense.
I have no problem mounting an image with the name in quotes: (in this case R:\A.IMG is a floppy disk image on my RamDisk)
C:\> imdmount A "R:\A.IMG"
Drive A is mounted as R:\A.IMG
- It behaves the same without quotes (so I don't think there's any other special significance to the quites other than allowing spaces)
C:\> imgmount A R:\A.IMG
It's worth noting that SUBST shows a similar "Local drives only" error (with no quotes in the names) when applied to an IMGMOUNTed drive.
C:\> SUBST B: A:\XXX
SUBST failed. You either ,ade an error in your command limeor the target drive is already used.
It's only possible to use SUBST on Local drives
https://dunfield.themindfactory.com ; "Daves Old Computers" ; SW dev addict best known:
ImageDisk: rd/wr ANY floppy PChw can ; Micro-C: compiler for DOS+ManySmallCPU ; DDLINK: simple/small filetransfer(w/o netSW)via Lan/Lpt/Com
Like "mount", "imgmount" is referencing files/locations directly on the host which may have spaces in the names, so quotes make sense.
I have no problem mounting an image with the name in quotes: (in this case R:\A.IMG is a floppy disk image on my RamDisk)
C:\> imdmount A "R:\A.IMG"
Drive A is mounted as R:\A.IMG
- It behaves the same without quotes (so I don't think there's any other special significance to the quites other than allowing spaces)
C:\> imgmount A R:\A.IMG
It's worth noting that SUBST shows a similar "Local drives only" error (with no quotes in the names) when applied to an IMGMOUNTed drive.
C:\> SUBST B: A:\XXX
SUBST failed. You either ,ade an error in your command limeor the target drive is already used.
It's only possible to use SUBST on Local drives
Look again. You are quoting a full/entire pathname. OP is attempting to quote only a filename, which doesn't work for accessing files on a mounted drive because the translation layer doesn't handle quotes.
SUBST has nothing to do with this, IMGMOUNT is an internal DOSBox program.
Look again. You are quoting a full/entire pathname. OP is attempting to quote only a filename, which doesn't work for accessing files on a mounted drive because the translation layer doesn't handle quotes.
SUBST has nothing to do with this, IMGMOUNT is an internal DOSBox program.
I actually "got" that, what which is why I also said:
- It behaves the same without quotes (so I don't think there's any other special significance to the quites other than allowing spaces)
C:\> imgmount A R:\A.IMG
---
Worth noting: Directory/File names shown in the following text do NOT contain spaces, the commands shown work both WITH and WITHOUT quotes (I just didn't feel the need to quote everything twice)
---
I think IMGMOUNT handles quotes just fine (and I don't think it's going through a "translation layer"). If I place A.IMG in the DosBox home directory,
1C:\> imgmount A "a.img" 2Drive A is mounted as A.IMG
Works just fine!
but .. worth noting: If I switch to my R: drive first:
1C:\> R: 2R:\> imgmount A "a.img" 3Drive A is mounted as A.IMG
It also works even though A.IMG is NOT on my R: RamDrive now!
The reason is that imgmount is accessing host files directly, not through DosBox directory translation, and with no path it's referencing the DosBox home directory (where DosBox.EXE was started from)
--
Last time I looked SUBST is also a DosBox internal command, I have no SUBST.EXE or SUBST.COM anywhere in my mounted drives or PATH:
1C:\> subst 2SUBST failed. You either made an error in your commandline or the target drive is already used. 3It's only possible to use SUBST on Local drives 4C:\>
The reason I mentioned it is that it is also dealing with "mounting" drives (If you perform a SUBST - DosBox SUBST can't show or unSUBST SUBSTed drives, but MOUNT will show the SUBSTed directory as mounted on the SUBST drive, and MOUNT -U works to remove it), and as seen in the error message above it mentioned that you can only use it on "Local drives" (which was part of the original question)
1R:\>subst D: R:\ 2Drive D is mounted as local directory R:\ 3R:\>mount 4Current mounted drives are: 5Drive C is mounted as local directory C:\DosBox\C\ 6Drive D is mounted as local directory R:\ 7Drive R is mounted as local directory R:\ 8Drive Y is mounted as local directory C:\DosBox\ 9Drive Z is mounted as Internal Virtual Drive 10R:\>mount -u D: 11Drive D has successfully been removed. 12R:\>
https://dunfield.themindfactory.com ; "Daves Old Computers" ; SW dev addict best known:
ImageDisk: rd/wr ANY floppy PChw can ; Micro-C: compiler for DOS+ManySmallCPU ; DDLINK: simple/small filetransfer(w/o netSW)via Lan/Lpt/Com
Example:
Z:>mount d c:\images
Z:>d:
D:>imgmount c "70mb.img"
After writing my last response, I think the answer is fairly obvious.
It has nothing to do with quotes - what it does have to do with is that IMGMOUNT is referencing a HOST file, and without a PATH in the filename, it will assume it is located in the HOST current directory(where DosBox was launched)
For MOUNTing directories relative to previously MOUNTed "drives", DosBox provides the SUBST command.
but ... AFAIK there is no equivalent function for IMGMOUNTing relative - so you will have to supply the complete
HOST path (or put 70mb.img" in the DosBox home directory)
And ... if that full host path contains spaces - you will need quotes!
https://dunfield.themindfactory.com ; "Daves Old Computers" ; SW dev addict best known:
ImageDisk: rd/wr ANY floppy PChw can ; Micro-C: compiler for DOS+ManySmallCPU ; DDLINK: simple/small filetransfer(w/o netSW)via Lan/Lpt/Com
I actually "got" that, what which is why I also said:
- It behaves the same without quotes (so I don't think there's any other special significance to the quites other than allowing spaces)
C:\> imgmount A R:\A.IMG
---
Worth noting: Directory/File names shown in the following text do NOT contain spaces, the commands shown work both WITH and WITHOUT quotes (I just didn't feel the need to quote everything twice)
---
I think IMGMOUNT handles quotes just fine (and I don't think it's going through a "translation layer"). If I place A.IMG in the DosBox home directory,
1C:\> imgmount A "a.img" 2Drive A is mounted as A.IMG
Works just fine!
but .. worth noting: If I switch to my R: drive first:
1C:\> R: 2R:\> imgmount A "a.img" 3Drive A is mounted as A.IMG
It also works even though A.IMG is NOT on my R: RamDrive now!
Yes, and that's exactly why it's failing for OP: they're quoting a relative path but the file is NOT in the DOSBox home directory - it's in c:\images, mounted as d, which is the one case you didn't test yet. DOSBox attempts to find the fully quoted filename on the mounted D drive (which is actually c:\images), it fails because the translation layer can't find it (DOSBox uses the translation layer for all mounted filesystems to map long/invalid filenames to 8.3), then it looks for 70MB.img in the DOSBox home directory and that doesn't exist either. So it shows the error message. IMGMOUNT works perfectly fine to load files from mounted drives provided the translated filename is used - the quotes screw that up.
Is this clear now? A quoted path should refer to a location on the host machine, not a mounted drive because the translation layer can only understand the 8.3 filenames that it provides. If you want to ensure the IMGMOUNT command will work when specifying a file on a mounted drive, use DIR first to see what the translated filename is and specify it without quotes.
This isn't conjecture, it's easily verifiable by building DOSBox and following the control flow yourself with a debugger. So please stop arguing with me about it. And please stop mentioning SUBST - it has nothing to do with loading an image file, which is the root cause of the problem.