Opening a file...
...in posix:
int fd = open(file_name, O_READONLY);
...in winAPI:
HANDLE hFile = CreateFile(TEXT(file_name), GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
Getting the file size...
...in posix:
struct stat stbuf;
fstat(fd, &stbuf);
uintptr_t file_size = stbuf.st_size;
...in winAPI:
LARGE_INTEGER file_size;
#ifdef ENABLE_WINDOWS_EX
GetFileSizeEx(hFile, &file_size);
#else
DWORD high_part;
file_size.LowPart = GetFileSize(hFile, &high_part);
#endif
#ifndef ENABLE_WINDOWS_EX
file_size.HighPart = (LONG)high_part;
#endif
"It also shoots blue flames sometimes, which is startling in the most exquisite of ways." -- Not me