라벨이 open인 게시물 표시

Porting to OS/2: Case #14 open() and DASD access

On Unix-like systems, open() can open various devices including files, storages and so on. On OS/2 kLIBC as well, open() does like that. However, open() of kLIBC does not support DASD. If you open [x:] expecting to open a drive x: in DASD mode, your expectation will go wrong. Although open() for x: succeeds, it is not for DASD mode, but for a directory. The handle returned can be used with functions which do not alter a file position and contents. For examples, fchdir() and fstat(). Then what is how to open in DASD mode ? Use a wrapper function for DosOpen(). The following are the codes used by libdvdnav.  Colored By Color Scripter ™ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 #ifdef  __OS2__ #define  INCL_DOS #include  <os2safe.h> #include  <os2.h> #include  <io.h>      /* setmode() */ #include  <fcntl.h>   /* O_BINARY  *...