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

如何在Go中检测到损坏的符号链接?

I have tried opening the file with ff, _ := os.Open("Filename") and then running ffi, _ := ff.Stat().

Which is the closest thing I could find that provides any details, but that doesn't seem to be following the symlinks.

What I'm really trying to do is extract the original file name (which is deleted) from the symlink.

I'm on a Linux machine.

os.Readlink(filename) does it.

近期文章

  • 在内存中持有一张大地图,还是执行多个sql调用?
  • 在datastore.Query.Run(c).Next(x)上获取奇怪的错误
  • 表单输入值查询字符串顺序
  • 使用Go在片段结构中按时间平均
  • 如何从用C / C ++编写的DLL调用导出的函数,其返回类型为char *或string?
  • 如何获取文件的当前位置
  • 如何使Go测试与文件系统一起使用
  • 无法在全新的Go项目中加载软件包
  • Golang GAE-在数据存储区的结构中更改变量名称
  • 使用XSD过滤anyURI类型的XML元素
  • 如何在新进程中执行方法
  • 退出后,该任务将从cgroup中删除
  • golang null.String解码无法正常工作
  • 在golang中,如何将int类型的切片从一个函数返回到另一个函数?
  • 使用for范围内的goroutine运行范围
  • 没有gorm.Model列的Gorm查询
  • K8s更改配置映射并更新应用日志级别
  • 在切片上调用len()有多快?
  • 实现观察者设计模式的Go方法
  • 如何通过反射将非指针值复制到指针间接值

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华