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

标签 windows go

我正在使用 Go 处理一系列文件,我想指出文件是否已使用文件元数据进行处理。如果文件至少被处理过一次,但程序在一个小时内未处理,我想将其删除。

我认为 Windows 归档位是确定文件是否至少被处理过一次的好方法,因为这些文件是临时文件并且不会被备份以防止意外翻转 Windows 归档位。

最佳答案

使用 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

关于windows - 如何使用 Go 翻转文件的 Windows 存档位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44972209/

相关文章:

c++ - 发现用户是否具有管理员权限

c# - C#Windows Phone-结合音频和视频文件

c++ - DLL注册返回码0x80029c4a

linux - 有没有办法在 Windows 上运行 "createrepo"命令?

go - 部署时 "go: finding [package]"上的错误 3

go - 如何统计字符串中连续重复的字符个数

go - 如何使用FabCar计算平均价格

windows - 验证文件以进行测试

mysql - 删除无效

user-interface - 隐藏窗口删除所有内容后显示