18 #include <ndb_global.h>
20 #include <util/File.hpp>
30 if (stat(aFileName, &s) != 0)
39 if (stat(aFileName, &s) != 0)
48 if (fstat(fileno(f), &s) != 0)
80 return open(m_fileName, m_fileMode);
86 assert(m_file == NULL);
87 if(m_fileName != aFileName){
95 if ((m_file = ::fopen(m_fileName, m_fileMode))== NULL)
106 return (m_file != NULL);
131 retval = ::fclose(m_file);
132 while ( (retval != 0) && (errno == EINTR) ){
133 retval = ::fclose(m_file);
140 ndbout_c(
"ERROR: Close file error in File.cpp for %s",strerror(errno));
151 return ::fread(buf, itemSize, nitems, m_file);
157 return ::fread((
void*)&buf[start], 1, length, m_file);
163 return readChar(buf, 0, (
long)strlen(buf));
169 return ::fwrite(buf, size_arg, nitems, m_file);
175 return ::fwrite((
const void*)&buf[start],
sizeof(
char), length, m_file);
181 return writeChar(buf, 0, (
long)::strlen(buf));
199 return ::fflush(m_file);;