delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/03/16/05:32:18

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <38D0B7F5.7D4529DB@netinsight.net>
Date: Thu, 16 Mar 2000 11:31:17 +0100
From: Tomas Pihl <tomas DOT pihl AT netinsight DOT net>
Organization: Net Insight AB
X-Mailer: Mozilla 4.7 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin AT sourceware DOT cygnus DOT com
Subject: Multiple fopens fails with permission denied

I've installed B20.1 (full.exe) on a NT4.0 SP6 machine. When I try
running the below included program I get:

bash-2.02$ ./a.exe
Couldn't open '/dev/com1' for input
open: Permission denied

It doesn't matter in which order I make the calls - fopen() always fail
on the second fopen. Any ideas?

int main()
{
   FILE *fdin;
   FILE *fdout;
   char* device = "/dev/com1";

   if ((fdout = fopen(device, "wb")) == NULL) {
      printf("Couldn't open '%s' for output\n", device);
      perror("open");
      exit(1);
   }
   if ((fdin = fopen(device, "rb")) == NULL) {
      printf("Couldn't open '%s' for input\n", device);
      perror("open");
      exit(1);
   }
}

-- 
Tomas Pihl                    Net Insight AB
tomas DOT pihl AT netinsight DOT net     Box 42093, SE-126 14 STOCKHOLM, SWEDEN
Phone:  +46-8-685 04 95       Visiting address: Västberga Allé 9
Fax:    +46-8-685 04 20       http://www.netinsight.net

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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