linux - 为什么 `test -w /tv` 给出不正确的否定结果?
问题描述
这是那里的问题的派生
在树莓派上的 docker-container(Docker 版本 20.10.7)中,我有一个/tv
由 docker 安装的 nfs mount()。
我不明白为什么 bash 错误地告诉我这个文件夹不可写:
root@6c5dd99ee211:/> if [ -w /tv ]; then echo "WRITABLE"; else echo "NOT WRITABLE"; fi
NOT WRITABLE
root@6c5dd99ee211:/> ls /tv/test
ls: cannot access '/tv/test': No such file or directory
root@6c5dd99ee211:/> touch /tv/test
root@6c5dd99ee211:/> ls /tv/test
/tv/test
它确实拥有所有权限:
root@7f0a44aad8a9:/> ls -la /tv
total 8
drwxrwxrwx 1 abc abc 3826 Jul 27 14:18 .
drwxr-xr-x 1 root root 4096 Jul 27 14:12 ..
drwxrwxrwx 1 abc abc 988 May 13 07:30 DARK
... (a lot of other folders)
-rwxrwxrwx 1 abc abc 4 Jul 27 14:18 test
我的码头工人撰写文件:
version: "3.4"
services:
bazarr:
image: ghcr.io/linuxserver/bazarr
container_name: bazarr
volumes:
- shows:/tv
ports:
- 6767:6767
dns: 1.1.1.1
restart: unless-stopped
volumes:
shows:
driver_opts:
type: "nfs"
o: "nfsvers=3,addr=xxx,soft,rw"
device: ":xxx"
怎么了 ?
解决方案
推荐阅读
- javascript - 从另一个函数javascript调用子函数
- linux - 如何将所有表的定义转储到 PostgreSQL 中特定模式的文本文件
- c# - 从特定 URL SharePoint C# 获取文件时出错
- javascript - 如何在 react native 中解决这个问题:组件异常
- dask - 可以从 fastparquet 获得正确的统计数据
- ios - 如何在 swift 中使基类属性通用,以便与多种模型类型一起使用?
- python - 有太多 uwsgi OSError 消息
- python - 为什么我不能正确使用 pandas.DataFrame.plot.bar()?
- node.js - 如何使用 NodeGit 列出所有文件?(相当于'git ls-files')
- javascript - 如何在 React JS 中遍历地图