Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ file is empty

/*-------------------------------------------------------------------
 Returns a boolean indicating if a file is empty (true) or not (false)
-------------------------------------------------------------------*/
bool FileIsEmpty(string Filepath)
{
   struct stat buffer;
   stat(Filepath.c_str(), &buffer);
   return (buffer.st_size == 0);
}
 
PREVIOUS NEXT
Tagged: #file #empty
ADD COMMENT
Topic
Name
2+4 =