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 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序