delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/21/22:28:14

From: peter AT agnes DOT dida DOT physik DOT uni-essen DOT de (Peter Gerwinski)
Newsgroups: comp.os.msdos.djgpp
Subject: `access' function and `prn' etc.
Date: 21 Jan 1997 13:17:48 GMT
Organization: Universitaet Essen, Germany
Lines: 29
Message-ID: <5c2fls$a3s@sun3.uni-essen.de>
Reply-To: peter DOT gerwinski AT uni-essen DOT de
NNTP-Posting-Host: agnes.dida.physik.uni-essen.de
Summary: `access' function applied to `prn' tells "not writeable"
Keywords: access, devices
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Hello,

when applying the `access' function to DOS device files like `prn'
or `lpt1', it returns "not writeable":

    /* test.c */

    #include <stdio.h>
    #include <unistd.h>

    int main ( void )
    {
      printf ( "%d\n", access ( "prn", W_OK ) );  /* yields -1 */
      return 0;
    } /* main */

Is this intended, or is it a bug in the C library (or in my
configuration)?  It causes that you cannot print at all with
GNU Pascal because GPC's run time library always calls "access"
before opening a file.

Thanks in advance,

    Peter

      e-mail:  peter DOT gerwinski AT uni-essen DOT de
home address:  D\"usseldorfer Str. 35, 45145 Essen, Germany
         WWW:  http://agnes.dida.physik.uni-essen.de/~peter/

- Raw text -


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