VOGONS


parameters not properly transmitted

Topic actions

First post, by cdeval

User metadata
Rank Newbie
Rank
Newbie

Hi,

I have a program called : probleme.exe
I give it 2 parameters : a file with DAT extension and a username

for exemple :

probleme.exe addsous2.dat toto

under XP it works (but in fullscreen, that's why I get dosbox)
under dosbox the parameters transmitted to probleme.exe are limited to 8 characters.
for last exemple, probleme.exe receive addsous2 as name of file. So It can't find it of course.

if I type :

probleme.exe add1.dat toto

it works but second parameter is not transmitted

Is it a bug ?

I attach the program in zip file.
Thank's a lot for help

Reply 1 of 21, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

How would the filename look like in XP?

DOS only supports 8.3 character filenames so that's all you'll get in DOSBox.

If your saying that the parameters only accept a certain length then that is something different but filenames can only be 8.3 characters. (It's not a bug it's a feature).

How To Ask Questions The Smart Way
Make your games work offline

Reply 2 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

hmm wonder what it uses to read the parameters. the commandline arguments parts is larger then 100 characters

Water flows down the stream
How to ask questions the smart way!

Reply 3 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

18614380: FILES:file open command 2 file ADDSOUS2.DAT.sco

hmm seems we have a bug. when there is more then one . present
or some other thing that causes the .sco to be added to the filename

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 21, by cdeval

User metadata
Rank Newbie
Rank
Newbie

Hi,

format 8.3 is respected in "addsous2.dat". But, dosbox transmits only 8 characters INCLUDING extension.
Try

probleme fract1.dat toto

and you will have result :
code fract1.d unknown (trunc at 8 characters) and the second parameter "toto" seems not transmitted.

The line "probleme.exe addsous2.dat toto" works fine in XP command line and not in dosbox.

Any idea to avoid this problem ?
Thank's

Reply 5 of 21, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

xp!=dos

Reply 6 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

would have to debug to see what goes wrong in dosbox.
as work around.
rename addsous2.dat to adsous2.sco
and start application
probleme addsous2 toto

Water flows down the stream
How to ask questions the smart way!

Reply 7 of 21, by cdeval

User metadata
Rank Newbie
Rank
Newbie

Hi,

this program is a pure dos program, not xp ! It works fine with dos.

Qbix, how do you get

18614380: FILES:file open command 2 file ADDSOUS2.DAT.sco 

?. It would help me to see what is transmitted to the program.exe and perhaps bypass this problem.
Thank's a lot for your answers.

Reply 8 of 21, by cdeval

User metadata
Rank Newbie
Rank
Newbie

I get "unable to open file"

Reply 9 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

debug version of dosbox. should be a topic in development

Water flows down the stream
How to ask questions the smart way!

Reply 10 of 21, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

this program is a pure dos program, not xp

You're running it under XP. Means you're NOT comparing behaviour of
dosbox against dos, but against xp's style of interpreting what it thinks
dos would do, which is by times very different from dos.

Reply 11 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

try making the .dat files read only.
It seems to work better if .dat.sco results in an illegal file or file not found error. Have to check it against real dos

Water flows down the stream
How to ask questions the smart way!

Reply 12 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

try this patch

Index: src/dos/dos_files.cpp
===================================================================
RCS file: /cvsroot/dosbox/dosbox/src/dos/dos_files.cpp,v
retrieving revision 1.102
diff -u -r1.102 dos_files.cpp
--- src/dos/dos_files.cpp 5 Oct 2008 14:44:52 -0000 1.102
+++ src/dos/dos_files.cpp 24 Nov 2008 19:57:02 -0000
@@ -158,6 +158,11 @@
if (lastdir!=0) strcat(fullname,"\\");
char * ext=strchr(tempdir,'.');
if (ext) {
+ if(strchr(ext+1,'.')) { //another dot in the extension =>file not found. check for 2 dots in dirs
+ DOS_SetError(DOSERR_FILE_NOT_FOUND);
+ return false;
+ }
+
ext[4] = 0;
if((strlen(tempdir) - strlen(ext)) > 8) memmove(tempdir + 8, ext, 5);
} else tempdir[8]=0;

Water flows down the stream
How to ask questions the smart way!

Reply 13 of 21, by cdeval

User metadata
Rank Newbie
Rank
Newbie

Thank's for your job.
My problem : I don't know how to try this patch. I have to compile a dosbox development version ?

Reply 14 of 21, by cdeval

User metadata
Rank Newbie
Rank
Newbie

18614380: FILES:file open command 2 file ADDSOUS2.DAT.sco

hmm seems we have a bug. when there is more then one . present
or some other thing that causes the .sco to be added to the filename

Hi,
I think the program "probleme.exe" add extension .sco to the second argument and launch a dos command with this extension.
"probleme.exe addsous2.dat toto" become "probleme.exe addsous2.dat toto.sco".

So, there is a problem with argument line with two "."
Your code modification should give with debugger :

file open command 2 file ADDSOUS2.DAT toto.sco

Does it work ?

I downloaded source, I saw the line to add. I will try to compile it.
Thank's again.

Reply 16 of 21, by cdeval

User metadata
Rank Newbie
Rank
Newbie

Thank's, but I can't test this patch because I get error when I run it :

Config : loading primary settings from config file dosbox.conf
Exit to error : "vga" is not a valid value for variable : machine

I put cdeval.exe file in the same directory of my dosbox.exe.
This dosbox.conf works fine with dosbox.exe
I even rename cdeval to dosbox : same error.

I don't understand....

Reply 17 of 21, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

The format of the configuration file is subject to change. Remove dosbox.conf and try again.

Reply 18 of 21, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

So DOES THIS HAPPEN IN DOS as well? I'll surely close this thread
as xp-commandshell comparisons are just crap.

Reply 19 of 21, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the application surely looks like it was used in real dos.
The application strcats .sco to each of the arguments and expects a file not found on the first one (as that file has 2 extension and hence can't be found). Crappy programming, but it worked on msdos 5.0

Water flows down the stream
How to ask questions the smart way!