From: "Ben Peddell" Newsgroups: comp.os.msdos.djgpp References: Subject: Re: call to 'open' causes all sleeping drives to awaken! Lines: 49 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: Date: Wed, 19 Feb 2003 22:17:54 +1000 NNTP-Posting-Host: 144.139.176.54 X-Trace: newsfeeds.bigpond.com 1045656368 144.139.176.54 (Wed, 19 Feb 2003 23:06:08 EST) NNTP-Posting-Date: Wed, 19 Feb 2003 23:06:08 EST Organization: Telstra BigPond Internet Services (http://www.bigpond.com) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Sander Pool wrote in message news:b2v0tc02dt0 AT enews4 DOT newsguy DOT com... > Hello, > > I noticed when I used a program compiled with DJGPP that all sleeping drives > in my system spin up. I examined the code and it only uses the 'open' call > to create file descriptors. So I wrote a tiny test program: > > #include > > main() > { > int f; > f = open("c:\\temp\\t.txt", O_RDONLY); > return 0; > } > > This compiles fine with gcc test.c. I wait for my drives to spin down and > then I run this program. I can hear each drive in turn spin up while the > program waits for this to happen. Why not find out whether the drives are spinning-up before or after the open() is issued, by printing something before the open(), and waiting for user input. If it is occurring before the open(), then it is probably the stub loader searching for CWSDPMI.EXE on the path. If you don't want this to happen, then ensure that DPMI is active before running the program. > > I compiled the same using MinGW and it does not behave this way. > > Has anyone else noticed this? It's reason enough for me to forgo DJGPP and > use MinGW instead. > > Sander > > PS djgpp gcc behaves the same way, it spins up all drives before starting > the compile. Of course if the drives are already spinning you won't notice > this. > > PPS Win2K > >