douzi7890 2017-07-07 13:37
浏览 25
已采纳

如何使用Go翻转文件的Windows存档位

I am processing a series of files using Go and I would like to indicate if a file has been processed using file metadata. If the file has been processed at least once but hasn't been processed by the program for an hour I would like to delete it.

I thought the Windows archive bit would be a good way of determining if the file has been processed at least once since these files are temporary and will not be backed up preventing accidental flipping of the Windows archive bit.

  • 写回答

1条回答 默认 最新

  • dongquan8753 2017-07-07 14:52
    关注

    Use the Microsoft Windows API:


    Retrieving and Changing File Attributes

    An application can retrieve the file attributes by using the GetFileAttributes or GetFileAttributesEx function. The CreateFile and SetFileAttributes functions can set many of the attributes.


    package windows

    import "golang.org/x/sys/windows"

    func GetFileAttributes

    func GetFileAttributesEx

    func SetFileAttributes

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 深度学习残差模块模型
  • ¥20 两个不同Subnet的点对点连接
  • ¥50 怎么判断同步时序逻辑电路和异步时序逻辑电路
  • ¥15 差动电流二次谐波的含量Matlab计算
  • ¥15 Can/caned 总线错误问题,错误显示控制器要发1,结果总线检测到0
  • ¥15 C#如何调用串口数据
  • ¥15 MATLAB与单片机串口通信
  • ¥15 L76k模块的GPS的使用
  • ¥15 请帮我看一看数电项目如何设计
  • ¥23 (标签-bug|关键词-密码错误加密)