升级10.13.1之后 ntfs-3g brew 安装失败,会有以下提示:
Last 15 lines from /Users/dany/Library/Logs/Homebrew/ntfs-3g/02.make:
clang -DHAVE_CONFIG_H -I. -I.. -DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -I../include/ntfs-3g -DPLUGIN_DIR=\"/usr/local/Cellar/ntfs-3g/2017.3.23/lib/ntfs-3g\" -g -O2 -Wall -c -o lowntfs_3g-lowntfs-3g.o `test -f 'lowntfs-3g.c' || echo './'`lowntfs-3g.c
clang -DHAVE_CONFIG_H -I. -I.. -DFUSE_USE_VERSION=26 -D_FILE_OFFSET_BITS=64 -D_DARWIN_USE_64_BIT_INODE -I/usr/local/include/osxfuse/fuse -I../include/ntfs-3g -DPLUGIN_DIR=\"/usr/local/Cellar/ntfs-3g/2017.3.23/lib/ntfs-3g\" -g -O2 -Wall -c -o lowntfs_3g-ntfs-3g_common.o `test -f 'ntfs-3g_common.c' || echo './'`ntfs-3g_common.c
/bin/sh ../libtool --tag=CC --mode=link clang -I../include/ntfs-3g -g -O2 -Wall -lintl -framework CoreFoundation -o ntfs-3g.probe ntfs_3g_probe-ntfs-3g.probe.o ../libntfs-3g/libntfs-3g.la -lc
lowntfs-3g.c:1932:29: error: no member named 'st_atim' in 'struct stat'
= timespec2ntfs(stin->st_atim);
~~~~ ^
lowntfs-3g.c:1938:29: error: no member named 'st_mtim' in 'struct stat'
= timespec2ntfs(stin->st_mtim);
~~~~ ^
2 errors generated.
找一下这个stat的定义:
find /Applications/Xcode.app/ -name "stat.h"
/Applications/Xcode.app//Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/stat.h
发现这个结构是修改了:
struct stat {
dev_t st_dev; /* [XSI] ID of device containing file */
ino_t st_ino; /* [XSI] File serial number */
mode_t st_mode; /* [XSI] Mode of file (see below) */
nlink_t st_nlink; /* [XSI] Number of hard links */
uid_t st_uid; /* [XSI] User ID of the file */
gid_t st_gid; /* [XSI] Group ID of the file */
dev_t st_rdev; /* [XSI] Device ID */
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
struct timespec st_atimespec; /* time of last access */
struct timespec st_mtimespec; /* time of last data modification */
struct timespec st_ctimespec; /* time of last status change */
#else
time_t st_atime; /* [XSI] Time of last access */
long st_atimensec; /* nsec of last access */
time_t st_mtime; /* [XSI] Last data modification time */
long st_mtimensec; /* last data modification nsec */
time_t st_ctime; /* [XSI] Time of last status change */
long st_ctimensec; /* nsec of last status change */
#endif
off_t st_size; /* [XSI] file size, in bytes */
blkcnt_t st_blocks; /* [XSI] blocks allocated for file */
blksize_t st_blksize; /* [XSI] optimal blocksize for I/O */
__uint32_t st_flags; /* user defined flags for file */
__uint32_t st_gen; /* file generation number */
__int32_t st_lspare; /* RESERVED: DO NOT USE! */
__int64_t st_qspare[2]; /* RESERVED: DO NOT USE! */
};
ntfs-3g-2017.3.23.tgz解压出来,
#define _DARWIN_C_SOURCE
把
stin->st_atim 和
stin->st_mtim 修成上面两个的名字,
./configure --prefix=/usr/local/Cellar/ntfs-3g/2017.3.23 --exec-prefix=/usr/
makesudo make install
解决问题