RageFileObjDirect *RageFileObjDirect::Copy() const
{
	int iErr;
	RageFileObjDirect *ret = MakeFileObjDirect( m_sPath, m_iMode, iErr );

	if( ret == NULL )
		RageException::Throw( "Couldn't reopen \"%s\": %s", m_sPath.c_str(), strerror(iErr) );

	ret->Seek( (int)lseek( m_iFD, 0, SEEK_CUR ) );

	return ret;
}
예제 #2
0
RageFileObjDirect *RageFileObjDirect::Copy() const
{
	int iErr;
	RageFileObjDirect *ret = new RageFileObjDirect;

	if( ret->OpenInternal( m_sPath, m_iMode, iErr ) )
	{
		ret->Seek( lseek( m_iFD, 0, SEEK_CUR ) );
		return ret;
	}

	RageException::Throw( "Couldn't reopen \"%s\": %s", m_sPath.c_str(), strerror(iErr) );
	delete ret;
	return NULL;
}