VOGONS

Common searches


First post, by luigi

User metadata
Rank Newbie
Rank
Newbie

Hy, sorry for my probably bad english-writing...from Italy!

I've installed today the Dosbox on my Laptop Windows XP. Greate!

I need to run one application i've written 15 years ago with Oracle sqlforms 2.3 (MsDos version).

I have mounted the directory of Oracle(ver.6) database with:

"mount c d:\oracle6" and the execution of the script (sqldba.exe) for the database is great. The database works well, and I can access to the data using one MsDos Oracle tool (sqlplus.exe).

The problem is my application (a fourth generation application) that need another Oracle tool (runform.exe) to be executed.

Runform.exe when runs try to write a buffer record of 0 byte and i'm sure that's it want to write into the drive "Z:\"
Runform.exe can't start and the message that gives to me is that it "Couldn't create record buffer file".

Normally (on my old MsDos desktop) runform.exe was writing this buffer file on "C:\".

Question: There is the chance to have some bytes of space in "Z:\" for this buffer file of Oracle ?

Thanks. Luigi Tribolo

Reply 1 of 9, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

Z is not a real drive. It probably checks the path or comspec variables. What you might do (inside DOSBox) is:

copy z:\command.com c:\
set comspec=C:\COMMAND.COM
path=c:\;z:\

If it works, you only need to do the first line once. You can add the other two to the [autoexec] portion of dosbox.conf.

My site: Ramblings on mostly tech stuff.

Reply 2 of 9, by luigi

User metadata
Rank Newbie
Rank
Newbie

Thank's for the answer.

I've already tried before (and now again to be sure) but no result.

It continue to writing me "Couldn't create record buffer file".

I'm afraid that this "runform.exe" try to create this record buffer with some direct address, because I've tried with an old desktop, booting with MsDos 6.22 from the floppy disk (A:), the comspec is = a:\command.com, the path starts with "a:\;...." but the buffer record is written on "c:\".

O maybe there are some I/O problems?..

luigi

Reply 3 of 9, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

Are you sure you're also actually starting the program from drive C: (that is: does the prompt actually start with C: )? Perhaps it just writes to the current drive.

My site: Ramblings on mostly tech stuff.

Reply 4 of 9, by luigi

User metadata
Rank Newbie
Rank
Newbie

You are exactly, Kippesoep.

I have tried now on the old desktop MsDos 6.20

The runform.exe program writes the buffer record file on the root (\) of the drive from where I execute runform.exe. So isn't the "path" or the "comspec" driving the address for this small buffer record files.

Now, on the new laptop Xp i've tried again to run "runform.exe" from the "C:\" of DosBox, ma it doesn't start and still writes "Couldn't create record buffer file".

The "runform.exe oracle book help" tell's me that happen when there is no space on the hard disk (but with the dir command on "c:\" from Dosbox shows 100mb) or there are I/O problems.

luigi

Reply 5 of 9, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

When you mount the "C:\" in dosbox you can specify a higher value for drive space.

Ex: "Mount c D:\oracle6 -freesize 500"

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

Reply 7 of 9, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie

luigi sent me a small demo at my request. I've used it to debug and found an error in DOSBox' file open code.

The program uses a temporary file "2" in the root of the running drive. (If it already exists, it tries "3" etc). It does this by calling INT21/AH=3D ("open existing file") with DS:DX pointing to "\2".

DOSBox attempts to open this file. It doesn't exist, so it tries to determine which error code to return: 2 (file not found) or 3 (path not found).

In the function "PathExists", it zeroes out the last '\' in the path. Since, in case of a file in the root directory of the current drive (i.e. no drive letter), this is also the first and only '\', it becomes an empty string. DOS_MakeName then interprets this as invalid and error code 3 (path not found) gets set. Since the root of the current drive must by definition exist, the program doesn't check for this error code, only error 2 (file not found) and in getting an unexpected error, gives up.

The fix is quite simple. In src/dos/dos_files.cpp:

static bool PathExists(char* name) {
char* leading = strrchr(name,'\\');
if(!leading) return true;
char temp[CROSS_LEN];
strcpy(temp,name);
leading = strrchr(temp,'\\');
*leading = 0;
Bit8u drive;char fulldir[DOS_PATHLENGTH];
if (!DOS_MakeName(temp,fulldir,&drive)) return false;
if(!Drives[drive]->TestDir(fulldir)) return false;
return true;
}

should become:

static bool PathExists(char* name) {
char* leading = strrchr(name,'\\');
if(!leading) return true;
char temp[CROSS_LEN];
strcpy(temp,name);
leading = strrchr(temp,'\\');
if (leading == temp) return true;
*leading = 0;
Bit8u drive;char fulldir[DOS_PATHLENGTH];
if (!DOS_MakeName(temp,fulldir,&drive)) return false;
if(!Drives[drive]->TestDir(fulldir)) return false;
return true;
}

When this is implemented, Luigi's demo runs just fine.

Attached is the patch.

Attachments

  • Filename
    root_exists.diff
    File size
    582 Bytes
    Downloads
    182 downloads
    File license
    Fair use/fair dealing exception

Reply 9 of 9, by luigi

User metadata
Rank Newbie
Rank
Newbie

Thanks Kippesoep for resolving the test case and for answering me.

For me was the first time to get into this Forum and it is really nice to see people that try to help each other.

Thanks also to DosFreak and wd for giving time to this test case.

Best regards.

luigi