home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Source Code 1992 March
/
Source_Code_CD-ROM_Walnut_Creek_March_1992.iso
/
usenet
/
altsrcs
/
1
/
1755
< prev
next >
Wrap
Internet Message Format
|
1990-12-28
|
1KB
From: tjr@cbnewsc.att.com (thomas.j.roberts)
Newsgroups: alt.sources
Subject: Re: elvis on a PC - Quick-C
Message-ID: <1990Aug30.142650.29519@cbnewsc.att.com>
Date: 30 Aug 90 14:26:50 GMT
From article <6887@vax1.acs.udel.EDU>, by bruschke@vax1.acs.udel.EDU (Michiel Bruschke):
>
> In article 2160 of alt.sources Marvin Kraska writes:
>
>> However, I have noticed that on the PC, lost clusters are reported
>>by "chkdsk" on the drive that the temporary file is placed. Sure
>>enough, the recovered file is elvis's temp. I glanced at the tmp.c
>>code, and didn't see anything obvious.
This (aparently) happens only when you have text in named cut-buffers,
and you switch files.
MS-DOS cannot rename a file that is open. elvis does this in cut.c,
function cutswitch(). This BUG has been in MS-DOS since version 2.0,
and is not fixed in 3.3; I suspect it would be difficult to fix in
any version of MS-DOS.
This fix (Turbo C) works for me:
In file cut.c, replace the line [within #ifdef TOS || MSDOS]
rename(tmpname, cutname);
with:
#if MSDOS /* TJR Fix - part 1 of 2 (MS-DOS cannot rename an open file) */
close(fd), close(tmpfd);
tmpfd = -1;
#endif
rename(tmpname, cutname);
#if MSDOS /* TJR Fix - part 2 of 2 */
j = open(cutname, O_RDWR | O_BINARY);
if(j != fd) {
dup2(j,fd);
close(j);
}
#endif
elvis seems to be a GREAT service provided by Steve Kirkendall - Thanks!
I have already sent this fix to him.
Good luck.
Tom Roberts
att!ihlpl!tjrob