Cygwin ::stat() 给出“没有这样的文件或目录”;用于安装 cygdrive 的 Samba

发布于 2024-10-18 14:35:27 字数 416 浏览 12 评论 0原文

我有一些代码在路径名上调用 ::stat() ,该路径名在 Centos 上运行良好,但在 Cygwin 上,当提供的路径名是 samba 安装驱动器上的目录时,它会失败:

struct stat info;

int result1 = ::stat("/cygdrive/h/", &info)
int errno1 = errno;
int result2 = ::stat("/cygdrive/", &info)
int errno2 = errno;

有了这个,我可以看到值:

result1 == -1
errno1 == 2
result2 == 0
errno2 == 0

我怎样才能stat() 从 Cygwin 成功安装了 samba 驱动器?

I have some code calling ::stat() on a pathname which works fine on Centos, but on Cygwin, it fails when the supplied pathname is a directory on a samba mounted drive:

struct stat info;

int result1 = ::stat("/cygdrive/h/", &info)
int errno1 = errno;
int result2 = ::stat("/cygdrive/", &info)
int errno2 = errno;

With this, I can see the values:

result1 == -1
errno1 == 2
result2 == 0
errno2 == 0

How can I stat() a samba mounted drive successfully from Cygwin?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文