8#ifndef _DIRECTORY_FSYNC_
9#define _DIRECTORY_FSYNC_
10/* open a directory for reading and fsync the resultant fd */
11int cDirectoryFsync(char *path)
15 struct stat fdstat = {0};
17 fd = open(path, O_RDONLY);
23 /* ensure that opened fd is a directory fd. Otherwise, fsync will fail (on a read-only file descriptor */
24 ret = fstat(fd,&fdstat);
30 if(!S_ISDIR(fdstat.st_mode))
35 /* execute the fsync */
37#if defined(__APPLE__) && defined(__MACH__) && defined(F_FULLFSYNC)
38 ret = fcntl(fd, F_FULLFSYNC);
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list