sqlparser/file.cpp
// Get content of the file (without terminating with 'x0')
Get content of the file (without terminating with 'x0')
Get content of the file ( without terminating with ' x0 ' )
int File::GetContent(const char *file, void *input, size_t len)
{
	if(file == NULL)
		return -1;
	int fileHandle = -1;
#ifdef WIN32
	fileHandle = _open(file, _O_RDONLY | _O_BINARY);	
#else
	fileHandle = open(file, O_RDONLY);
#endif
	if(fileHandle == -1)
	{
		return -1;
	}
	int bytesRead = _read(fileHandle, input, len);
	if(bytesRead == -1)
	{
		_close(fileHandle);
		return -1;
	}
	_close(fileHandle);
	return 0;
}
int File :: GetContent ( const char * file , void * input , size_t len ) { if ( file == NULL ) return -1 ; int fileHandle = -1 ; #ifdef WIN32 fileHandle = _open ( file , _O_RDONLY | _O_BINARY ) ; #else fileHandle = open ( file , O_RDONLY ) ; #endif if ( fileHandle == -1 ) { return -1 ; } int bytesRead = _read ( fileHandle , input , len ) ; if ( bytesRead == -1 ) { _close ( fileHandle ) ; return -1 ; } _close ( fileHandle ) ; return 0 ; }
Get content of the file (without terminating with 'x0')
Get content of the file ( without terminating with ' x0 ' )
// open the file // Read the file content to the buffer