| delorie.com/archives/browse.cgi | search |
| From: | eyal DOT ben-david AT aks DOT com |
| To: | morphine AT hops DOT cs DOT jhu DOT edu |
| cc: | djgpp AT delorie DOT com |
| Message-ID: | <422564FD.005B6F93.00@aks.com> |
| Date: | Sun, 24 Aug 1997 18:47:10 +0200 |
| Subject: | Re: file_exists() |
| Mime-Version: | 1.0 |
On 8/24/97 5:22:56 AM Michael Phelps wrote:
>On Fri, 22 Aug 1997 Marco DOT Monteiro AT delorie DOT com wrote:
>
>> Hello,
>>
>> how can i inspect if a file exists?
>> I'm using the function following function; is there a better one?
>>
>
in C++ this could be written as follows:
#include <fstream.h>
bool file_exist(const char* filename)
{
return ifstream(filename, ios::in | ios::nocreate).good();
}
Eyal.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |