summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/os_win/os_exist.c
blob: ab3805f19df2b590fa323ee20f7c3aa153f1dd7c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*-
 * Copyright (c) 2008-2014 WiredTiger, Inc.
 *	All rights reserved.
 *
 * See the file LICENSE for redistribution information.
 */

#include "wt_internal.h"

/*
 * __wt_exist --
 *	Return if the file exists.
 */
int
__wt_exist(WT_SESSION_IMPL *session, const char *filename, int *existp)
{
	WT_DECL_RET;
	char *path;

	WT_RET(__wt_filename(session, filename, &path));

	ret = GetFileAttributesA(path);

	__wt_free(session, path);

	if (ret != INVALID_FILE_ATTRIBUTES)
		*existp = 1;
	else
		*existp = 0;

	return (0);
}