delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/19/08:36:54

From: Frank Frederiksen <ff AT kom DOT auc DOT dk>
To: djgpp AT delorie DOT com
Subject: Re: Strange errors with _get_dev_info
Message-Id: <E10NzQb-0004tJ-00@hercules.kom.auc.dk>
Sender: Frank Frederiksen <ff AT cpk DOT auc DOT dk>
Date: Fri, 19 Mar 1999 14:35:09 +0100
Reply-To: djgpp AT delorie DOT com

Hi there,

A week ago, I posted this to news, but have not seen it in the mail
archived, so I will post it to the mailing list instead.
I have looked through the FAQ and searched the mail arvhived, but to no
success.

Could somebody plaese help?



In article <5d8G2.1031$dh DOT 1058 AT sunsite DOT auc DOT dk>,
	ff AT kom DOT auc DOT dk (Frank Frederiksen) writes:
> Hi,
> 
> I have a problen with gcc on my computer. The following piece of code
> illustrates the problem:
> 
> 
> #include <stdio.h>
> #include <dir.h>
> #include <io.h>
> #include <errno.h>
> 
> int main(void)
> {
>   int drive;
> 
>   /* Scan from c: and upwards */
>   for(drive=2;drive<setdisk(getdisk());drive++) {
>     if(_get_dev_info(drive)==-1)
>       printf("Error on drive %c (%d)\n", drive+'A', errno);
>     else
>       printf("Drive %c is OK\n", drive+'A');
>   }
> 
>   return(0);
> }
> 
> 
> compiled with gcc -o test test.c -O2 -Wall -W
> I get the following result:
> 
> Drive C is OK
> Drive D is OK
> Drive E is OK
> Error on drive F (6)
> Drive G is OK
> Error on drive H (6)
> Error on drive I (6)
> Error on drive J (6)
> Error on drive K (6)
> Error on drive L (6)
> Error on drive M (6)
> Error on drive N (6)
> Error on drive O (6)
> Error on drive P (6)
> Error on drive Q (6)
> Error on drive R (6)
> Error on drive S (6)
> Error on drive T (6)
> Error on drive U (6)
> Error on drive V (6)
> Error on drive W (6)
> Error on drive X (6)
> Error on drive Y (6)
> Error on drive Z (6)
> 
> dir f: gives:
> 
>  Volume in drive F is DISK_F         Serial number is 1D14:11EC
>  Directory of  f:\*.*
> 
> B2B11        <DIR>     26-02-99  15.28 
> B2B12        <DIR>     26-02-99  15.09 
> DSP          <DIR>     22-02-99  14.55 
> PC           <DIR>     22-02-99  14.55 
> b2b.txt          2347   1-03-99  12.04 
> dspmain0.exe    78938  19-02-99  12.31 
> dspmain0.ldr   213240  19-02-99  12.31 
> dspmain0.map    74908  19-02-99  12.31 
> dspmain1.exe    34676  19-02-99  12.31 
> dspmain1.ldr    94536  19-02-99  12.31 
> dspmain1.map    33382  19-02-99  12.31 
> dspmain2.exe    35678  19-02-99  12.31 
> dspmain2.ldr   102960  19-02-99  12.31 
> dspmain2.map    33523  19-02-99  12.31 
> dspmain3.exe    23590  19-02-99  12.32 
> dspmain3.ldr    63984  19-02-99  12.32 
> dspmain3.map    24406  19-02-99  12.32 
> f2ac9c00.ms0 65362200   2-03-99  13.53 
> f2ac9c00.ms1 65362200   2-03-99  13.53 
> f2ac9c00.mss 130734240  24-02-99  13.42 
> f2ac9c00.tmm      115  24-02-99  13.42 
> f2ac9c01.mss 142542240  24-02-99  13.45 
> f2ac9c01.tmm      115  24-02-99  13.45 
> f2ac9c02.mss 58508640  24-02-99  13.46 
> f2ac9c02.tmm      114  24-02-99  13.46 
> f2ac9c03.mss 210457920  24-02-99  13.54 
> f2ac9c03.tmm      115  24-02-99  13.54 
> f2ac9c04.mss 53962560  24-02-99  13.57 
> f2ac9c04.tmm      114  24-02-99  13.57 
> f2ac9h00.mss 144018240  24-02-99  13.28 
> f2ac9h00.tmm      115  24-02-99  13.28 
> f2ac9h01.mss 169621920  24-02-99  13.32 
> f2ac9h01.tmm      115  24-02-99  13.32 
> f2ac9h02.mss 56934240  24-02-99  13.33 
> f2ac9h02.tmm      114  24-02-99  13.33 
> file0000.chk   524288  12-03-83  12.33 
> file0001.chk    32768  12-03-83  12.33 
> playback.exe   328532  26-01-99  10.26 
> reset.bat          18  18-11-98  10.21 
> reset.cmd         147  18-11-98  10.21 
> sdma_dc.exe    532865  26-01-99  10.26 
> test21.cfg       1008  23-02-99  11.12 
> test_00.deb    160965  23-02-99  11.01 
> 1.099.902.076 bytes in 43 file(s)    1.100.742.656 bytes allocated
>  784.334.848 bytes free
> 
> and chkdsk f: gives:
> 
> Volume DISK_F      created 12-03-1999 12.43
> Volume Serial Number is 1D14-11EC
> 
> 2.146.467.840 bytes total disk space
>       131.072 bytes in 4 directories
> 1.362.001.920 bytes in 651 user files
>   784.334.848 bytes available on disk
> 
>        32.768 bytes in each allocation unit
>        65.505 total allocation units on disk
>        23.936 available allocation units on disk
> 
>       655.360 total bytes memory
>       472.848 bytes free
> 
> Instead of using CHKDSK, try using SCANDISK.  SCANDISK can reliably detect
> and fix a much wider range of disk problems.  For more information,
> type HELP SCANDISK from the command prompt.
> 
> 
> However, when I tried to redirect the output of the test.exe program
> to a file (test >res1) I got (note the failed drive has changed, and
> drive H which is a JAZ drive with no disk should fail):
> 
> Drive C is OK
> Drive D is OK
> Drive E is OK
> Drive F is OK
> Error on drive G (6)
> Drive H is OK
> Error on drive I (6)
> Error on drive J (6)
> Error on drive K (6)
> Error on drive L (6)
> Error on drive M (6)
> Error on drive N (6)
> Error on drive O (6)
> Error on drive P (6)
> Error on drive Q (6)
> Error on drive R (6)
> Error on drive S (6)
> Error on drive T (6)
> Error on drive U (6)
> Error on drive V (6)
> Error on drive W (6)
> Error on drive X (6)
> Error on drive Y (6)
> Error on drive Z (6)
> 
> 
> gcc -v gives:
> Reading specs from c:/ut/gcc/lib\specs
> gcc version 2.7.2.1
> 
> I am using (from ver):
> 4DOS 4.0   DOS 6.22
> 
> The disk configuration of the PC is:
> 
> disk1:  split into: 1GB (drive c)  & 1GB (drive e) 
> disk2:  split into: 2GB (drive d)  & 2GB (drive f)   & 800MB (drive g) 
> disk3:  optional JAZ drive (drive h) 1GB (no disk inserted)
> 
> 
> I have absolutely no idea what is going on here. Does anybody?
> 
> Frank Frederiksen

- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019