Path: chuka.playstation.co.uk!news From: Michael Garcia Newsgroups: scee.yaroze.programming.libraries Subject: reading cdrom using file descriptor functions Date: Wed, 03 May 2000 17:17:59 +1000 Organization: PlayStation Net Yaroze (SCEE) Lines: 155 Message-ID: <390FD2A6.900355E5@start.com.au> Reply-To: mgarcia@start.com.au NNTP-Posting-Host: 203.108.136.29 Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------C32E04333BE47415BDC2A700" X-Mailer: Mozilla 4.5 [en] (Win95; I) X-Accept-Language: en --------------C32E04333BE47415BDC2A700 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all :) I am porting a DOS program to NY and trying to read the CDROM with the ANIS C functions open() read() lseek()... Here is what I am trying to do. /********************** siocons test ************/ #include #include main() { int fd,ret; char f[] = "cdrom:\\DATA\\SOUND\\SAMPLE1.SEQ;1"; char text[1000]; printf("trying to open %s\n",f); fd = open(f,O_RDONLY); // | O_NOWAIT | O_NBLOCK | O_NOBUF); // just incase if(fd > 0) printf("open worked fd = %d\n",fd); else { printf("open failed fd = %d\n",fd); return; } printf("trying to read %s\n fd = %d\n",f,fd); ret = read(fd,&text,999); printf("ret = %d\n",ret); text[999] = 0; printf("File <%s> CONTAINS \n<%s>\n",f,text); close(fd); } This compiles but hangs when it hits fd = open(f,O_RDONLY); // | O_NOWAIT | O_NBLOCK | O_NOBUF); // just incase When this is ran using char f[] = "\\DATA\\SOUND\\SAMPLE1.SEQ;1"; // (no device - cdrom: ) it says that - \DATA\SOUND\SAMPLE1.SEQ;1 is not a device then it displays all devices available eg bu: ,tty:, cdrom: and exits. What is the correct device name for the cdrom eg cdrom??: I really don't want to use the CdlFILE functions ! BTW how do you convert CdlLOC type to a int to create a seek fuction? What did I miss? Lots of thanks in advance! G'day from Brisbane, Australia --------------C32E04333BE47415BDC2A700 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi all :)

I am porting a DOS program  to  NY and trying to read the CDROM with the  ANIS C functions  open() read() lseek()...

Here is what I am trying to do.
 
 

/********************** siocons test ************/
#include <libps.h>
#include <sys/file.h>

main()
{

     int fd,ret;
    char f[] = "cdrom:\\DATA\\SOUND\\SAMPLE1.SEQ;1";
    char text[1000];

     printf("trying to open %s\n",f);

     fd = open(f,O_RDONLY); // | O_NOWAIT | O_NBLOCK | O_NOBUF);     //   just incase
 
     if(fd > 0)
          printf("open worked fd = %d\n",fd);
     else
     {
          printf("open failed fd = %d\n",fd);
          return;
     }

     printf("trying to read %s\n fd = %d\n",f,fd);

     ret = read(fd,&text,999);

     printf("ret = %d\n",ret);

     text[999] = 0;

     printf("File <%s> CONTAINS \n<%s>\n",f,text);
 
     close(fd);
}
 

This compiles but hangs when it hits

 fd = open(f,O_RDONLY); // | O_NOWAIT | O_NBLOCK | O_NOBUF);     //   just incase

When this is ran using

char f[] = "\\DATA\\SOUND\\SAMPLE1.SEQ;1";  // (no device - cdrom:  )

it says that - \DATA\SOUND\SAMPLE1.SEQ;1  is not a device then

it displays all devices available eg bu: ,tty:, cdrom:
and exits.

What is the correct device name for the cdrom eg
cdrom??:

I really don't want to use the CdlFILE functions !
BTW how do you convert CdlLOC type to a int to create a seek  fuction?
 

What did I miss?

Lots of thanks in advance!
G'day from Brisbane, Australia
 
 
 
 
  --------------C32E04333BE47415BDC2A700--