mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58333 954022d7-b5bf-4e40-9824-e11837661b57
29 lines
681 B
C++
29 lines
681 B
C++
//#include "stdafx.h"
|
|
|
|
#include "File.h"
|
|
|
|
namespace FileSystem {
|
|
bool File::Exists(LPCTSTR path) {
|
|
WIN32_FIND_DATA findData;
|
|
ZeroMemory(&findData, sizeof(findData));
|
|
|
|
HANDLE handle = ::FindFirstFile(path, &findData);
|
|
|
|
bool fileExists = true;
|
|
if (handle == INVALID_HANDLE_VALUE)
|
|
fileExists = false;
|
|
FindClose(handle);
|
|
|
|
return fileExists;
|
|
}
|
|
bool File::Exists(const String& path) {
|
|
return Exists(path.c_str());
|
|
}
|
|
|
|
void File::Create(LPCTSTR path) {
|
|
CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
|
}
|
|
void File::Create(const String& path) {
|
|
Create(path.c_str());
|
|
}
|
|
} |