Esempio n. 1
0
isc_result_t
try_dir(const char *dirname) {
	isc_result_t result;
	isc_dir_t d;

	isc_dir_init(&d);
	result = isc_dir_open(&d, dirname);
	if (result == ISC_R_SUCCESS) {
		isc_dir_close(&d);
	}
	return (result);
}
Esempio n. 2
0
/*
 * Reposition directory stream at start.
 */
isc_result_t
isc_dir_reset(isc_dir_t *dir) {
	isc_result_t result;

	REQUIRE(VALID_DIR(dir) && dir->search_handle != INVALID_HANDLE_VALUE);
	REQUIRE(dir->dirname != NULL);

	/*
	 * NT cannot reposition the seek pointer to the beginning of the
	 * the directory stream, but rather the directory needs to be
	 * closed and reopened.  The latter might fail.
	 */

	isc_dir_close(dir);

	result = start_directory(dir);

	return (result);
}