Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » How to prevent the opening of a file that does not exist
Re: How to prevent the opening of a file that does not exist [message #3777 is a reply to message #3776] Sat, 24 June 2006 20:10 Go to previous message
mirek is currently offline  mirek
Messages: 13984
Registered: November 2005
Ultimate Member
IsOK == !IsError

Anyway, for FileIn, I tend to use operator bool:

FileIn in(...);
if(in) {
   // in was succesfuly opened
}


Actually, IsError is usually used at the end of write operation to find out whether always was written OK (e.g. there is enough capacity on target media, like:

FileOut out(...);
if(out) {
   ...write the stuff
   if(out.IsError())
      Exclamation("Error writing the file !");
}


Mirek
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: String - Unicode?
Next Topic: Translation Problems (German)
Goto Forum:
  


Current Time: Sat Jun 08 10:40:23 CEST 2024

Total time taken to generate the page: 0.02302 seconds