Forums

Do not have permission to edit text file?

I have a .txt file. Its only content is a single 0. I cannot edit this file. If the value is anything else, I can edit it. My app can't edit it either, which is a bigger problem, since the file exists solely to track a value should the app stop unexpectedly. Much of the time, this value is 0, and I need to store that value. Right now, I can't. I can code around the problem, but I don't think I should have to. :P

that certainly should not be the case.

  1. where is this file?
  2. who is the owner of this file (eg: do a ls -l to see)
  3. what is the code you are using to edit it?

also- how do u chg it from 0 to non-zero if you can't edit it?

  1. /home/thedrew4u/someDir/myFile.txt
  2. thedrew4you
  3. The built-in editor on the website. ie: click the file, or the edit icon.

also-I delete the file from the directory and upload a version with contents that aren't the number zero.

when you say you cannot edit the file- do you mean that when you click the file/edit icon, nothing shows up? Or there is no edit icon? I'm a bit confused.

I have absolutely the same problem. A .txt file contains 0 and after creation I can't edit it, can't even open it. From the files tab it has no edit button and from the dashboard when I try to open it, I have "You do not have the permissions to edit /home/username/f.txt." but I am the "username" I created that file. IDK but for some reason 1 byte files can't be edited after creation or something, so it can be bypassed by concatenating some text to value and reading only the value from the file.

How interesting! Yes, you're right. It looks like a file that contains just "0" is being miscategorised as a non-text file. I've logged a bug, we'll look into it.

This problem still exists.

I believe the file with a 0 bug has already been resolved. what is the exact file that you are trying to access? are you sure you have the correct permissions for it?

I am having this problem. I saved the .txt file with nothing in it, then went back to edit and am unable to do so. I am new to coding so this is a huge issue I dont know how to solve. I see others coded around it but I am not that experienced. Please help!! 1./home/sdlipkin/stocks.txt. 2.sdlipkin 3. No edit button at all. Cannot use dashboard to navigate to file. Permission denied.

which file are you trying to edit that doesn't have an edit button? I see that your /home/sdlipkin/stocks.txt file does have an edit button.

Yep, the same bug:

You do not have the permissions to edit /home/AzurLane/Bot/queue.txt.

You can see it in my files now. Text file with any of [0, 1, 2, ...] numbers loses an edit button and gets this message. And solutions?

It happens if the file has only one character

That's strange. We'll have to have a look at that to work out what is going on.

I'll wait for results of your researches :)

So... Are there any results? Or should I just try another method of saving data?

Looks like your queue.txt has the wrong permissions. How do you create and update it? Could you show the code?

There is no code :D

I created it by entering its name in "Enter new file name" and clicking "New empty file" button. Then I put "0" in it and clicked "Save".

@Azur

The only way I was able to get around it was by downloading the broken text file and editing it. After a couple tries of editing it and re uploading I was granted permissions again. Keep the file name the same just for continuity.

@ Dev Team

Thats how I fixed it, its a fine workaround. However the problem still consistently occurs if you have one or no characters in a text file. For example "0" will lead to not having permission to edit.

Hope that helps everyone!

Thanks! That sounds like a bug, and we'll look into it.

Similarly, I have this program which changes a text file, and I've noticed that when characters that can not be printed are written (\xXX or for example \x19), it denied me access to the text file in exactly the same way. However, when I rewrote it in the console it returned my editing access. It's not too problematic for me, only slows down debugging. Hope that helps.