¡@

Home 

c++ Programming Glossary: stat

Copy a file in an sane, safe and efficient way

http://stackoverflow.com/questions/10195343/copy-a-file-in-an-sane-safe-and-efficient-way

end n cout CPU TIME END START end start n cout TIME SEC static_cast double end start CLOCKS_PER_SEC n return 0 POSIX WAY.. end n cout CPU TIME END START end start n cout TIME SEC static_cast double end start CLOCKS_PER_SEC n return 0 KISS C Streambuffer.. end n cout CPU TIME END START end start n cout TIME SEC static_cast double end start CLOCKS_PER_SEC n return 0 COPY ALGORITHM..

Why can't you use offsetof on non-POD strucutures in C++?

http://stackoverflow.com/questions/1129894/why-cant-you-use-offsetof-on-non-pod-strucutures-in-c

#field in #inst cout offset_d i##inst field endl #define stat type field cout Static offset of #field in #type cout.flush.. main A iA B iB C iC D iD dyn A a dyn B a dyn C a dyn D a stat A a stat B a stat C a stat D a return 0 This will crash when.. iA B iB C iC D iD dyn A a dyn B a dyn C a dyn D a stat A a stat B a stat C a stat D a return 0 This will crash when trying to..

In C++, How to get MD5 hash of a file?

http://stackoverflow.com/questions/1220046/in-c-how-to-get-md5-hash-of-a-file

easily enough. #include sys types.h #include sys stat.h #include sys mman.h #include fcntl.h #include stdio.h #include.. file descriptor unsigned long get_size_by_fd int fd struct stat statbuf if fstat fd statbuf 0 exit 1 return statbuf.st_size.. descriptor unsigned long get_size_by_fd int fd struct stat statbuf if fstat fd statbuf 0 exit 1 return statbuf.st_size int main..

Where is a file mounted?

http://stackoverflow.com/questions/2337139/where-is-a-file-mounted

one of the etc mtab entries. How do I know when I do fstat them and compare the inode numbers Find the longest directory.. filename struct mntent mnt char buf size_t buflen struct stat s FILE fp dev_t dev if stat filename s 0 return NULL dev s.st_dev.. char buf size_t buflen struct stat s FILE fp dev_t dev if stat filename s 0 return NULL dev s.st_dev if fp setmntent proc mounts..

C/C++ function definitions without assembly

http://stackoverflow.com/questions/2442966/c-c-function-definitions-without-assembly

JUMP_INIT close INTUSE _IO_file_close JUMP_INIT stat INTUSE _IO_file_stat JUMP_INIT showmanyc _IO_default_showmanyc.. close INTUSE _IO_file_close JUMP_INIT stat INTUSE _IO_file_stat JUMP_INIT showmanyc _IO_default_showmanyc JUMP_INIT imbue _IO_default_imbue.. is mapped by a macro to _IO_new_do_write and we have this static _IO_size_t new_do_write fp data to_do _IO_FILE fp const char..

How to get total cpu usage in Linux (c++)

http://stackoverflow.com/questions/3017162/how-to-get-total-cpu-usage-in-linux-c

c linux cpu usage share improve this question cat proc stat http www.linuxhowtos.org System procstat.htm I agree with this.. cat proc stat http www.linuxhowtos.org System procstat.htm I agree with this answer above. The cpu line in this file..

How to determine CPU and memory consumption from inside a process?

http://stackoverflow.com/questions/63166/how-to-determine-cpu-and-memory-consumption-from-inside-a-process

CPU currently used #include TCHAR.h #include pdh.h static PDH_HQUERY cpuQuery static PDH_HCOUNTER cpuTotal void init.. #include TCHAR.h #include pdh.h static PDH_HQUERY cpuQuery static PDH_HCOUNTER cpuTotal void init PdhOpenQuery NULL NULL &cpuQuery.. CPU currently used by current process #include windows.h static ULARGE_INTEGER lastCPU lastSysCPU lastUserCPU static int numProcessors..

How to get memory usage at run time in c++?

http://stackoverflow.com/questions/669438/how-to-get-memory-usage-at-run-time-in-c

using std string vm_usage 0.0 resident_set 0.0 'file' stat seems to give the most reliable results ifstream stat_stream.. stat seems to give the most reliable results ifstream stat_stream proc self stat ios_base in dummy vars for leading entries.. the most reliable results ifstream stat_stream proc self stat ios_base in dummy vars for leading entries in stat that we don't..

How can I create directory tree in C++/Linux?

http://stackoverflow.com/questions/675039/how-can-i-create-directory-tree-in-c-linux

#endif HAVE_UNISTD_H #include string.h #include sysstat.h Fix up for Windows inc mode_t typedef struct stat Stat #ifndef.. sysstat.h Fix up for Windows inc mode_t typedef struct stat Stat #ifndef lint Prevent over aggressive optimizers from eliminating.. v 1.13 2012 07 15 00 40 37 jleffler Exp #endif lint static int do_mkdir const char path mode_t mode Stat st int status..

recursive folder scanning in c++

http://stackoverflow.com/questions/983376/recursive-folder-scanning-in-c

fnmatch in this example. #include ftw.h #include fnmatch.h static const char filters .jpg .jpeg .gif .png static int callback.. fnmatch.h static const char filters .jpg .jpeg .gif .png static int callback const char fpath const struct stat sb int typeflag.. .png static int callback const char fpath const struct stat sb int typeflag if it's a file if typeflag FTW_F int i for each..