Question: CSAP > 32 MB absread/abswrite DOES work !?!?!? (but CSAP does

Eric Auer <[email protected]>
Newsgroups gmane.os.freedos.devel
Message-ID <[email protected]>
Hi,
please tell me if this code that I found in SORTDIR.C of CSAP does the
handling of abswrite > 32 MB correctly. If yes, it would be an idea to
rewrite DISKIO.C in my UNDELETE tool in the same way. A32SW is a flag
that triggers "> 32 MB style" absread/abswrite there:

if (a32sw | abswrite(Disk - 'A', Dpb.ClusterSize + 1,
                              WHICHSECTOR, (char *) &Buffer[OFFSET]) {
#if 1
                a32.nsect = Dpb.ClusterSize + 1;
                a32.sector = WHICHSECTOR
;                a32.xferad = (unsigned char *) &Buffer[OFFSET];
                a32sw=1;
                if (abswrite(Disk - 'A', -1, 0, &a32) != 0) {    /* EWS */
#endif
                        fprintf(stderr, "Error writing directory.\n");
                        exit(1);
                }
#if 1
                }
#endif

a32sw is initially 0, and gets set to 1 on the first error with the old
style call.

a32 is of type:
struct absr32m
 {
  long sector;
  int  nsect;
  unsigned char far  *xferad;
 };

This looks generally promising. Please tell me if this does in fact work.
If yes, please provide a patch to MY DISKIO.C in my UNDELETE tool that
will obsolete BIGDISK.ASM :-)). Thanks a lot!

Eric


PS: This leaves the "abnormal program termination" or "endless loop" type
CSAP crashes even more unexplained! The source is in C. Maybe you can find
the bug. Ideas: Sorting of directories with 0..1 files and/or directories
and with 0 sized files could be broken in a way that does not show up in
other cases. BUT George reports that CSAP crashes almost unconditionally :-(.

Maybe it gets subdirectories wrong and only \ right? Whatever. PLEASE
be careful. If you are unlucky, CSAP will crash -after- sorting, at the
time when it rewrites the directory. This can trash your filesystem and/or
directory. Only experiment on drives that you have a backup of or if you
"know what you are doing".

Eric
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.