ComputerCraft

ComputerCraft

21M Downloads

[Suggestion]Make fs.isReadOnly() check for FilePermission

JakobDev opened this issue ยท 6 comments

commented

If you don't have write access to a file on your Computer, fs.isReadOnly should return false.

commented

What exactly you have in mind when you say - no write access?

commented

chmod u-w Filename

commented

@Wojbie What he means is when a file is marked as read-only for the current user i.e. the user cannot write to the file.

commented

Are we speaking about single player setup then? I would find it weird for there to be file not belonging to server running server user.

Anyhow now that exact problem has been explained I agree. This is rather weird edge case but is should be fixable.

commented

@Wilma456 I believe you mean true -- that's what fs.isReadOnly returns for read-only files (no write access)

commented

CC (like Minecraft itself), relies on you having write access to your save directory. much more than this method would break if that were not the case!