Re: > Subject: Re: [Dev-C++] directory I/O handling problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Per W. <pw...@ia...> - 2005-07-04 13:13:07
|
A good reason for stat(), opendir() etc. to generate segfaults is if YOU send an invalid file/directory name pointer as parameter. If the pointer isn't valid, it doesn't matter which method you use to try and check for the existence of a directory or file. The OS does it's best to do the correct thing when you send in correct parameters. You have to do your best to make sure your parameters are always correct! /Per W On Mon, 4 Jul 2005, Big Playah wrote: > Hi, > > > Message: 5 > > Date: Sat, 2 Jul 2005 21:18:24 -0500 > > From: Josh McFarlane <da...@gm...> > > Reply-To: Josh McFarlane <da...@gm...> > > Subject: Re: [Dev-C++] directory I/O handling problem > > Cc: dev...@li... > > > Why not just call opendir() and check for a null pointer after calling it? > > because it raises some segfaults with stupid arguments which might > happen... that's what I want to avoid > > tom > > -- > Coupe Quattro '89 > Typ81 custom '84 > > > ---------------------------------- |