linux写U盘,避免拔出U盘后文件丢失,挂载方法

往U盘写文件close之前先调用下面两个函数,避免拔出U盘后文件丢失
pDest是文件句柄
fflush(pDest);
   fdatasync(fileno(pDest));
挂载nfs方法
cd tmp
mkdir nfs
mount -t nfs -o nolock 192.168.39.17:/home/log/log1 /tmp/nfs
大部分转载 小部分自写
原文地址:https://www.cnblogs.com/8586/p/1931695.html