VOGONS


Creating directories for Dosbox

Topic actions

Reply 20 of 33, by Gene Wirchenko

User metadata
Rank Member
Rank
Member
Dominus wrote:

Ok, sorry, I take my foot out of my mouth regarding the validity of the path. I was obviously wrong about that part

Apology accepted. I have rarely used them with a drive letter myself.

As to other postings about the error message being correct, if it does not inform or worse, confuses, then it is not a good error message for that user. It might be fine for you, but not someone less knowledgeable. I have to watch this in error messages that I write for my apps. I have had to change some, because my boss did not understand them, and he was right: the next version was much clearer, even to me.

Sincerely,

Gene Wirchenko

Reply 21 of 33, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The error message is not misleading and you are not "boss".

Reply 22 of 33, by Gene Wirchenko

User metadata
Rank Member
Rank
Member
wd wrote:

The error message is not misleading and you are not "boss".

Argument by assertion?

If the error message were something like "A mount path must be root-based.", it would make more sense. Contrary to the message, C:WS3 can be mounted; it just has to be specified as a root-based path: C:\whatever\WS3.

Of course not. I did not claim to be boss. What brought this on?

Sincerely,

Gene Wirchenko

Reply 23 of 33, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
Gene Wirchenko wrote:

If the error message were something like "A mount path must be root-based.", it would make more sense.

Mount paths do not have to be root-based (aka absolute); relative paths are acceptable.

The thread starter tried to mount C:WC3, causing DOSBox to attempt mounting C:<working directory\>WC3. Because that path presumably did not exist, DOSBox reported that it could not be mounted. DOSBox's error message may be terse, but it's not inaccurate or misleading.

Reply 24 of 33, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

As I wrote before how much code does need to be written to know where the problem with the path is. If it's just an error in the pathname (for example ws3 instead of wc3) your proposed error message would not be misleading but just not applying at all to the actual problem.
Right now, if the path is wrong it's wrong.
Should dosbox really try to figure out what the problem is?
So when some writes
Mount c c:ws3
And that path doesn't exist, should dosbox check whether it is some variation of this (c:wc3, c:ws1, etc.) or whether there might be a ws3 folder elsewehere (c:whatever/ws3) or even some variation of that (c:whatever/wc3)? Do you now see that this can not be done?

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 25 of 33, by Gene Wirchenko

User metadata
Rank Member
Rank
Member
Dominus wrote:

As I wrote before how much code does need to be written to know where the problem with the path is. If it's just an error in the pathname (for example ws3 instead of wc3) your proposed error message would not be misleading but just not applying at all to the actual problem.
Right now, if the path is wrong it's wrong.

Right now, the definition of wrong is such that relative paths are not allowed. This would be easy to change. About all that would have to be done is to remove the part the disallows relative paths.

Should dosbox really try to figure out what the problem is?

When "figure out" is whether a directory exists, yes. It does that right now, just not for relative paths.

So when some writes
Mount c c:ws3
And that path doesn't exist, should dosbox check whether it is some variation of this (c:wc3, c:ws1, etc.) or whether there might be a ws3 folder elsewehere (c:whatever/ws3) or even some variation of that (c:whatever/wc3)? Do you now see that this can not be done?

Windows program shortcuts have a "Start in" property. That is the working directory that the program starts in. Any relative directory would, logically, be in terms of that. Far from not being possible, it is very possible.

A relative directory is unambiguous for a given current working directory. There is no need to go hunting. If the relative directory specified does not exist, throw an error.

Relative paths date back to DOS. This is not something that was added in Windows.

Sincerely,

Gene Wirchenko

Reply 26 of 33, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

RELATIVE PATHS WORK FINE
ERROR MESSAGES ARE FINE
WTF ARE YOU TALKING ABOUT

Reply 27 of 33, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Gene, did you read ripsaws post?

If you did how do you explain your last post?

Reply 28 of 33, by Gene Wirchenko

User metadata
Rank Member
Rank
Member
Dominus wrote:

Gene, did you read ripsaws post?

If you did how do you explain your last post?

I must have missed it.

I could not get relative paths to work though without a bit of a fight. The DOSBox executable does not have a starting directory property. After various tries, I found that DOSBox considers its program directory to be the root-based directory that a relative path would be based off, at least for c:.

Sincerely,

Gene Wirchenko

Reply 29 of 33, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

At least we don't need a 3rd page for that now.

Reply 30 of 33, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author
Gene Wirchenko wrote:

DOSBox considers its program directory to be the root-based directory that a relative path would be based off

DOSBox, like most programs in Windows, has its working directory set to its program directory by default; but when a shortcut is used to start a program, the shortcut's "Start in" property can be changed to use a different working directory.

Reply 31 of 33, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

When "figure out" is whether a directory exists, yes.

gene are you serious? That sounds as if you expect Dosbox to scan ALL folders on the hard drive(s) and from there figure out what the problem is.
Back to the OPs problem and what seems to be what you want:
He writes
Mount c c:wc3
But c:wc3 doesn't exist. C:whatever/wc3 does. What he relly wanted was to
Mount c c:whatever/wc3
(not to mention that he actually would need to just mount c:whatever)
Without scanning all hard drives Dosbox can't know what's wrong, so the error message is correct.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 32 of 33, by Gene Wirchenko

User metadata
Rank Member
Rank
Member
Dominus wrote:

When "figure out" is whether a directory exists, yes.

gene are you serious? That sounds as if you expect Dosbox to scan ALL folders on the hard drive(s) and from there figure out what the problem is.

You have misread. Note that I wrote "whether *a* directory exists", and I have written nothing about that a scan should be done.

I simply mean to check whether the directory exists. For example, given a root path of c:\root\path and a relative path of c:relative\path, the directory to look for is c:\root\path\relative\path. If that directory exists, proceed with the mount. If it does not, throw an error.

What I do not understand is why there has to be any special handling. DOS and Windows do understand relative paths.

Back to the OPs problem and what seems to be what you want: He writes Mount c c:wc3 But c:wc3 doesn't exist. C:whatever/wc3 does […]
Show full quote

Back to the OPs problem and what seems to be what you want:
He writes
Mount c c:wc3
But c:wc3 doesn't exist. C:whatever/wc3 does. What he relly wanted was to
Mount c c:whatever/wc3
(not to mention that he actually would need to just mount c:whatever)
Without scanning all hard drives Dosbox can't know what's wrong, so the error message is correct.

The error message is correct, but misleading. "Directory c:wc3 not found" would be clearer. "Directory c:\whatever\wc3 not found" would be more so.

Sincerely,

Gene Wirchenko

Reply 33 of 33, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

There is no special handling, there is no misleading message, and this is just going way too stupid for too long anyways.