Skip to content

Instantly share code, notes, and snippets.

@GermanAizek
Created August 16, 2020 13:44
Show Gist options
  • Save GermanAizek/19fbbe73d63fede64d7d245f69f0408f to your computer and use it in GitHub Desktop.
Save GermanAizek/19fbbe73d63fede64d7d245f69f0408f to your computer and use it in GitHub Desktop.
#include <iostream>
#include <fcntl.h>
int main()
{
mode_t perms = S_IRWXU;
int fd = open("log", O_CREAT | O_EXCL, perms);
if (fd >= 0) {
std::cout << "[OK] CreateFileA\n";
} else {
std::cout << "[FAIL] CreateFileA\n";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment