sqlparser/file.cpp
// Write the buffer to the file
Write the buffer to the file
Write the buffer to the file
int File::Write(const char *file, const char* content, size_t size)
{
	 if(file == NULL || content == NULL)
		return -1;
#ifdef WIN32
  int fileh = _open(file, _O_CREAT | _O_RDWR | _O_BINARY | _O_TRUNC, _S_IREAD | _S_IWRITE);
#else
  int fileh = open(file, O_CREAT | O_RDWR, 0666);
#endif
   if(fileh == -1)
	   return -1;
   int rc = _write(fileh, content, size);
   _close(fileh);
   return rc;
}
int File :: Write ( const char * file , const char * content , size_t size ) { if ( file == NULL || content == NULL ) return -1 ; #ifdef WIN32 int fileh = _open ( file , _O_CREAT | _O_RDWR | _O_BINARY | _O_TRUNC , _S_IREAD | _S_IWRITE ) ; #else int fileh = open ( file , O_CREAT | O_RDWR , 0666 ) ; #endif if ( fileh == -1 ) return -1 ; int rc = _write ( fileh , content , size ) ; _close ( fileh ) ; return rc ; }
Write the buffer to the file
Write the buffer to the file
// open the file // if _S_IWRITE is not set, the Read Only file is created (at least on Windows) // open the file // write the content to the file 