TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: David Muir
from: Thomas Seeling
date: 1995-09-05 20:56:40
subject: Not Communications

Hallo, David!

*** Am Dienstag 29. August 1995 um 16:08 schrieb David Muir an Peter Fitzsimmons:

 DM>     Is there a way of which you're aware to determine if a given drive is
 DM> a CD-ROM

=== Cut ===

#define KBFROMUNITS(u,a,s) ((u)*(a)*(s)/1024)

  APIRET       rc;
  FSALLOCATE   buf;
  FSQBUFFER2  *fsbuf;
  ULONG        bufsize;
  ULONG        drv;
  char         xbuf[256],nbuf[3]={'C',':','\0'};

  bufsize=sizeof(xbuf);
  fsbuf=(FSQBUFFER2 *)xbuf;
  nbuf[0]=drive;
  rc=DosQueryFSAttach(nbuf,0,FSAIL_QUERYNAME,fsbuf,&bufsize);
  printf("%d\n",fsbuf->iType);
/* This is what you want: CD-Roms have a type of "CDFS" */
  printf("%s\n",fsbuf->szName+fsbuf->cbName+1);
  bufsize=sizeof(buf);
  rc=DosQueryFSInfo(drv,FSIL_ALLOC,&buf,bufsize);
  if (rc==0) {
    printf("%d %d %d %d\n",    
KBFROMUNITS(buf.cUnitAvail,buf.cSectorUnit,buf.cbSector);
      KBFROMUNITS(buf.cUnit,     buf.cSectorUnit,buf.cbSector);
      buf.cbSector;
      buf.cSectorUnit);
  }
  else
    return -1;
=== Cut ===


Tschau...Thomas

--- E3-32/1.11-32/2.50+
* Origin: Die TeX-Box +49-6034-1455 V.34 -930022 ISDN 24h (2:244/1130.42)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 244/1130 24/999 2/777 105/42 712/515 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.