Exemplo n.º 1
0
Arquivo: main.c Projeto: taysom/tau
/* init_test creates a scratch directory in the specified
 * test directory.
 *
 * It also creates some test files to help in testing. Because,
 * we want to test >4 Gigfiles but it takes time to create a file
 * that big, we create it here and allow its size to be set by
 * the user -- use a small size when developing the tests.
 */
void init_test (char *dir)
{
	char *suffix;

	if (Local_option.seed_rand) srandom(nsecs());
	CheckRoot = (geteuid() == 0);

	chdir(dir);
	chdirErr(ENOTDIR, "/etc/passwd");

	suffix = RndName();
	Scratch = Catstr("scratch_", suffix, 0);
	free(suffix);
	mkdir(Scratch, 0777);
	chdir(Scratch);

	CrFile(BigFile, Local_option.size_big_file);
	CrFile(EmptyFile, 0);
	CrFile(OneFile, 1);
}
Exemplo n.º 2
0
void* CMapFile::GetMapView(const TCHAR* filename)
{
	Close(m_del_flag);
	
	if (filename != NULL) 
	{
		_tcscpy_s(m_filename, _countof(m_filename), filename);
		
		if(CrFile() && CrMap() && CrView())
			return m_mapView;
	}
	Close(m_del_flag);
	return NULL;
}