Multiple fopens fails with permission denied

Tomas Pihl
Thu Mar 16 02:31:00 GMT 2000

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);
   if ((fdin = fopen(device, "rb")) == NULL) {
      printf("Couldn't open '%s' for input\n", device);

Tomas Pihl                    Net Insight AB     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

Want to unsubscribe from this list?
Send a message to

More information about the Cygwin mailing list