我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何在Windows上独占锁定文件?

I want to lock file exclusively on Windows environment, but syscall.Flock isn't supported by Windows. Is there any way to implement it?

I tried this article's method however it doesn't work (syscall.Syscall6 raises "Access is denied." error).

Windows c++ api could help you. The LockFile and LockFileEx functions seem enough to help.

近期文章

  • 尝试在Linux / Ubuntu上使用oracle库构建静态CGO可执行文件
  • 有没有一种好的方法可以不公开JSON有效负载中的某些struct属性?
  • Golang中的方法级执行时间指标?
  • Go模板将数据从一个传递到另一个
  • 每个持久连接使用HTTP内存
  • Golang http.NewRequest:无效的内容类型
  • golang,调用WinVolumeInformation winapi函数
  • Beego:如何在会话超时时重定向到其他页面
  • 如何在Go-lang中的包之间共享变量
  • 无法使用具有部分属性的golang的mgo查找文档
  • 在Geany中运行Go
  • 具有Golang的LiteIDE GDB
  • 我真的对导入所需的软件包感到困惑,但是nobuild_files排除了其所有文件
  • 无法使用包“ golang.org/x/oauth2”与facebook进行身份验证:“缺少redirect_uri参数”
  • 为什么垃圾收集器没有清除内存块?
  • Golang惯用方式从多行字符串中删除空白行
  • golang内存爆炸:newdefer
  • 在解析错误时控制fmt.Parse输出
  • termbox-go-从控制台读取数据
  • 循环和闭包中的Println输出不同的值

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华