Questions <ul>
This is a violation code.
/*we ignore file size for char/block devices, sockets etc*/ if(S_ISREG(fileinfo.st_mode)) uploadfilesize= fileinfo.st_size; }
and causes an error
error LNK2019: unresolved external symbol _S_ISREG referenced in function _operate file tool_operate.obj
The following questions refer to them.
Apparently, S_ISREG () is part of a lot of posix macros and apparently should tell us if the file is a “regular file”, but all the examples I found contain files related to linux.
Windows , FindFirstFile, FindNextFile win32 api, , .
gcc/mingw, stat(). sys/stat.h .
, :
#include <sys/stat.h> #if defined(WIN32) || defined(WIN64) // Copied from linux libc sys/stat.h: #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) #endif
curl 7.21.5 setup.h :
#if !defined(S_ISREG) && defined(S_IFMT) && defined(S_IFREG) #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif
(_S_ISREG). MinGW lib S_ISREG <sys/stat.h>
_S_ISREG
S_ISREG
<sys/stat.h>
, .