使用Raspian Buster写文件

问题描述 投票:0回答:1

我想用Raspian Buster写一个文件。使用Raspian Stretch(依赖Debian 9)可以解决任何问题。相同的代码在Raspian Buster(Debian 10)上不起作用。

File myFile = new File("/media/usb/test.properties");
boolean success = myFile.createNewFile();

即使目录具有权限777 oktal,当尝试写入文件时,始终会发生以下异常:

java.io.IOException: Das Dateisystem ist nur lesbar (my translation: the file system is readable only)

当我第一次在目录中手动创建指定的文件,并使用Java代码检查权限时,它会显示以下结果:

File f = new File("/media/usb/test.properties");
f.exists(): true
f.canRead(): true
f.canWrite(): false

Raspian Stretch和Buster之间有什么变化?我在做什么错?

感谢您的帮助!

raspbian raspbian-stretch raspbian-buster
1个回答
0
投票

根据问题解决https://github.com/eclipse/jetty.project/issues/3579

现在可以正常工作!

© www.soinside.com 2019 - 2024. All rights reserved.