home *** CD-ROM | disk | FTP | other *** search
- Date: 17 Dec 90 04:11:51 GMT
- From: Forrest Gehrke <feg@dodger.att.com>
- Newsgroups: comp.binaries.ibm.pc
- Subject: find, locate files on disk
- Summary: An enhanced version of an earlier posting
- Keywords: util
-
- The recent file finder program FIND which was distributed in c.b.i.p
- just would not work for me on my ATT 6300+. All I would get is the
- useage message.
-
- There seemed to be something wrong with the switchar but printf
- statements I tried in the source that was provided seemingly did not
- verify that suspicion.
-
- But notice this code fragment in main:
- ----------------------------------------------------
- main(int argc, char *argv[])
- {
- int i, j, k;
- int done=0;
- int enable;
- char *option;
-
- /*
- * FInd out what the switch character is and set the switch and
- * directory seperator for use in this program accordingly
- */
- _AH=0x37;
- _AL=0;
- __int__(0x21);
- switchar=_DX;
- if (switchar == '/')
- dirsep = '\\';
- else
- dirsep='/';
- -----------------------------------------------------
- _DX is 16 bits. The expression immediately following IF was not being
- executed and a printf statement using %x verified that the switchar
- was being set equal to f02f. Since the leading f0 will not print
- unless %x is used in a printf statement instead of %c, it seemingly
- reported the switchar equal to '/' which it was not.
-
- Changing the code to _DL, the desired byte size, corrected the program
- and it now ran as the useage message said it should.
-
- Perhaps some machines may not have trouble with this, else how did it
- ever pass muster?
-
- Forrest Gehrke feg@dodger.att.com
-