Article View: comp.sys.amiga.tech
Article #8371Believe it or not, I can't figure this out...
From: Leo 'Bols Ewhac' Schwab
Date: Wed, 23 Mar 1988 09:20
Date: Wed, 23 Mar 1988 09:20
71 lines
2604 bytes
2604 bytes
[ The "Alpha, Beta, Gamma, Diga" joke wasn't mine, by the way... ]
I've bumped into a real poser, and it involves the DOS (as all weird
Amiga problems do).
I have the following code sequence:
--------
savestuff ()
{
register struct frame *this;
long file, dirlock, olddirlock;
int i, here;
char filename[32], err[40], *s;
strcpy (filename, getfile ());
/* Check to see if it currently exists */
if (dirlock = Lock (filename, ACCESS_READ)) {
UnLock (dirlock);
notice (0, "File exists.");
return;
}
/* Create the file... er.. directory */
if (!(dirlock = CreateDir (filename))) {
notice (0, "Couldn't create file.");
return;
}
/* Move to the directory just created to contain the stuff */
olddirlock = CurrentDir (dirlock);
/* Start saving off the data */
if (!(file = Open ("blah blah", MODE_NEWFILE))) {
strcpy (err, "File open failed.");
notice (0, err);
goto bombout;
}
--------
Now, here's the stumper: If I enter a filename of the form "foo"
when prompted by the getfile() routine, everything happens correctly: A
directory is created in the current directory, and the data file is written
inside that directory.
However, if I give a filename of the form "DEV:foo", it will
correctly create the directory, but the data file is written in the same
place i.e. into DEV:foo.
What I want to happen in a general sense is to have this:
1> dir opt a
foo (dir)
datafile
What I'm getting (in the second case) is this:
1> dir opt a
foo (dir)
datafile
That is, 'datafile' and 'foo' are in the same directory. I want
'datafile' to be inside the directory 'foo'.
Any ideas? Any workarounds? Any questions? Any answers? Any
rags, any bones, any bottles today......
_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape ihnp4!ptsfa -\
\_ -_ Recumbent Bikes: dual ---> !{well,unicom}!ewhac
O----^o The Only Way To Fly. hplabs / (pronounced "AE-wack")
"Work FOR? I don't work FOR anybody! I'm just having fun." -- The Doctor
Technical Details
Message-ID:
<5512@well.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!decvax!ucbvax!hplabs!well!ewhacShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!decvax!ucbvax!hplabs!well!ewhac From: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Newsgroups: comp.sys.amiga.tech Subject: Believe it or not, I can't figure this out... Summary: The DOS is shafting me... Message-ID: <5512@well.UUCP> Date: 23 Mar 88 09:20:27 GMT Reply-To: ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) Organization: Amiga Biotechnology Labs and Nuclear Test Grounds, Nevada. Lines: 71