+8
Fixed

Save file: Permission denied (wrong behavior)!

Hey Guy 11 years ago updated by Alexander Blach (Developer) 11 years ago 34

(Temporary Fix: just reopen the file to add code / changes!)


Error-message:

"The document “filename” could not be saved. You don’t have permission."


Steps I made to get the error:

1. Open Textastic

2. Press CMD + N to get a new window

3. Type some code

4. Press CMD + S to save

5. Now add some new code to the already written ..

6. Try to save again


The folders I was trying to save the file to was #1 desktop and #2 downloads, folders that belong to my user-account so I do have permission to them. :)

Answer

Answer
Fixed

This problem should be fixed in Textastic 2.0 which is now available on the Mac App Store.

I tried to follow the steps on my machine and it worked without a problem. Which Mac OS X version do you use? I tried it on 10.8.3.

Seem to have the same problem . . . Just create a HTML document, write some code, save it, write some more, try to save again, and then you get the message.  the only way you can resolve it is if you relaunch textastic. 


I have inclosed a picture of the error message:



Please fix this soon!

The problem happens when you change the syntax definition of an already saved file. This bug will be fixed in the next update.


The workaround is to immediately change the syntax definition after you create a new file and before you enter any characters.

Unfortunately the problem is not fixed for me in the latest version. Even the workaround you mentioned does not work for me. Another time..


1. open textastic

2. start typing (syntax is Plain Text or whatever)

3. save file as test.html

4. -> even if you now change the syntax to html the error occurrs

5. change the doc and try to save it


Damnit!

Are you absolutely sure you are using the latest version 1.1? You can check in the About screen. The new version also has tabs.


When I try to follow your steps it works without problems...

It is 1.1, for sure. I could give a screencast again but I think we're not gonna solve this problem by doing so. What a bummer but I've no idea what else we could do .. this was just to inform you about that. Thanks anyway.

Please create another screencast. I must be doing something different. It is very annoying indeed. Sorry for that.

It does. Everything worked for me and I could not reproduce it as long as iCloud was enabled. But, as soon as I disabled iCloud, I saw the same problem as you did. It's a variant of the problem that I thought I had fixed in 1.1.


So there seem to be two workarounds:


  1. change the syntax definition before saving the first time
  2. enable iCloud

On all of my development machines, iCloud is enabled, so I didn't see this issue.


I'll try to fix this problem. Thanks a lot for your patience and for your help.

As you've seen in the latest video, iCloud was disabled. But on my user account (which is not "screencast" as in the video ^^) I have iCloud enabled -> and the problem occurrs!

The same Mac OS X version over here, 10.8.3 ML.

Did you maybe save it under a file name that contains any special characters? Do you have any other apps running that might access newly created files? 

Both questions: no. But I've found something interesting:

Filename "test" -> no problems,

Filename "test.html" -> causes permission denied error.


Edit:

The Console-Log says:

24.03.13 15:24:38,755 Textastic[12262]: -[NSFileCoordinator itemAtURL:willMoveToURL:] could not get a sandbox extension. oldURL: file://localhost/Users/username/Desktop/test.html, newURL: file://localhost/Users/username/Desktop/test.txt


So, it would be:


1. Open Textastic

2. Press CMD + N to get a new window

3. Type some code

4. Press CMD + S to save and save it as test.html on the Desktop

5. Now add some new code to the already written ..

6. Try to save again


I'm not sure at which point you save it as test.txt and when it then gets moved to test.html.


Do you have iCloud enabled on your Mac? I do.



I don't know if that's too much to ask, but: if you would be able to record the problem in a short screencast, that would be terrific!

The problem is that I do not save the file as .txt by myself. When trying to save changes, Textastic puts the message into the log-file. I don't even want to use a .txt extension in this certain use-case so I don't know where it is coming from.


I tried this on two user-accounts, one had iCloud enabled - the other one had iCloud disabled. The problem occurred in both cases.


Video: No problem ;)

http://www.ipernity.com/doc/275771/14550035

Thanks a lot for the screencast!


I have done exactly the same as you did in the video. I even disabled iCloud because it didn't appear as an option in your save panel so you seem to have it disabled. 


I have typed the same characters and used the same menu items, but it works just fine on my iMac and on my Macbook Pro.


Could you try to use "Repair permissions" in Disk Utility? Maybe there is indeed a permission problem somewhere on your hard disk.

I just found this topic in a WriteRoom Google group which mentions the same "could not get a sandbox extension" error: https://groups.google.com/forum/#!msg/writeroomapp/GqBs6X1d8g0/EVhJZBgy1CcJ


This post is interesting:


If you open Console.app, do you an error containing this message when you try to save?
" -[NSFileCoordinator itemAtURL:willMoveToURL:] could not get a sandbox extension. "
If so, then the OS X sandbox is preventing WR from using that extension to save to and has decided that only *.txt or whatever will do. I'm not seeing *.md or *.mmd getting renamed on my end, but I'm having that problem with other extensions like *.org. 
It might be because I have several other Markdown editors installed, which is placating the sandbox regarding those extensions. Or something. In 10.8 there's a reference to a "related items" feature, but I actually am unable to find the documentation for it at all beyond a message from an Apple employee in October 2012 saying they were still working on the documentation for it.
That doesn't solve your problem, and I'm sorry about that as well as how long it took to get a reply up. 

I highlighted the interesting part. It sounds logical that another app might have messed up something in regards to file extensions that is preventing the sandboxing feature of the OS to change the file extension.


Ich schreibs jetzt mal auf deutsch, um zu vermeiden, dass wir aneinander vorbei reden. ^^


Ausgehend vom Video:

  1. Ich erhalte die Fehlermeldung
  2. Textastic wird geschlossen
  3. Ich öffne die HTML Datei per Doppelklick mit Textastic
  4. Änderungen werden vorgenommen
  5. Speichern (egal ob CMD+S oder Menü)
  6. Keine Fehlermeldung, Daten korrekt gespeichert.

Bei ein und der selben Datei! Da die Fehlermeldung nur besteht, bis ich die so angelegte Datei erneut in Textastic öffne, vermute ich, dass es sich nicht um generelle Probleme mit Zugriffsrechten handelt.


(Nur um sicher zu gehen habe ich das Festplattendienstprogramm nach solchen Fehlern suchen lassen. Nichts gefunden. Lustigerweise wird der Reparieren-Knopf dennoch klickbar ... ohne Wirkung. Anschließend habe ich den Mac in den Rescue Modus versetzt und diesen Terminal-Tipp (resetpassword) ausprobiert. Es wurden ebenfalls keine Fehler gefunden und auch keine gefixt.)


Tatsächlich habe ich jedoch vor einigen Tagen die Demoversionen der Programme ESPRESSO und CODA ausprobiert und wieder entfernt. TextWrangler spielt auch noch mit, aber die Programme haben sich alle nicht in die Haare bekommen. Falls eine Anwendung nun doch Mist gebaut hat: wie kann ich die Sandbox reparieren? :-O


Ich habe auch Espresso und Coda (und viele weitere Editoren) auf meinem Rechner, aber habe das Problem nicht. Leider gehen mir die Ideen aus, an was es liegen könnte :(

Anmerkung: mit TextEdit kann ich html Dateien auf dem Schreibtisch speichern, ohne eine solche Meldung zu bekommen. :S

Das wäre meine nächste Frage gewesen. Eigentlich müsste es bei TextEdit auch passieren, da diese App auch NSDocument-basiert ist und in der Sandbox läuft.

Mich würde ja interessieren, ob es auf einem anderen Mac geht. Oder ist das der einzige verfügbare Rechner?

I don't know how to proceed in order to resolve the problem. :(


Another interesting fact: I can reproduce this problem without adding .html to the filename! Here's how:


  1. Open Textastic
  2. CMD + N
  3. Type some code
  4. Change type to HTML (http://i45.tinypic.com/aubf5w.png)
  5. CMD + S, don't use .html in the filename
This will cause Textastic to come up with that sandbox-error-message at the first attempt for saving, not only when saving changes. But this time there's another log-entry in the console.

24.03.13 20:38:24,079 Textastic[932]: writeToURL:file://localhost/private/var/folders/zw/0lksw57916vct5nyx1_lkbtc0000gp/T/com.textasticapp.textastic-mac/TemporaryItems/(A%20Document%20Being%20Saved%20By%20Textastic)/myGeorgeousWebsite.html ofType:public.html error: - isMainThread: 0

One thing that can fix problems with file type registrations is to rebuild the launch services database.


Have a look at http://www.tuaw.com/2009/06/11/terminal-tips-rebuild-your-launch-services-database-to-clean-up/ on how to do this.


This is just a shot in the dark, but might be worth a try.

By the way: I did follow the steps and it is working just fine on my Macs...

Oh man, das geht sprachlich sehr durcheinander hier. Noch mal in Ruhe:

habe leider nur einen Mac zum testen zur Verfügung. Dass das Problem in TextEdit nicht auftritt, ist echt schräg. Die DB hatte ich im Laufe des Tages schon neu erzeugen lassen, leider ohne Erfolg (das mache ich wegen der vielen Mehrfacheinträge ohnehin öfter mal).


Neulich hat mir jemand zu Testzwecken mal nodejs (npm) und coffeescript installiert - habs jetzt wieder runtergeworfen, ohne Erfolg. Bist du dir Sicher, dass es nicht an irgend einem Seiteneffekt von Textastic liegen kann?


Im Grunde scheint es ja egal zu sein, welche Dateiendung die Datei hat - allein dass die Datei als HTML markiert wird reicht aus. Damit es deutlicher wird, hab ich noch mal fix ein Video erstellt: http://www.ipernity.com/doc/275771/14555925/


Also wenn du auch nicht weiter weißt, werd ich erst mal damit leben müssen. Trotzdem vielen vielen Dank für die Hilfe!


Noch kurz ein Feature-Request: derzeit muss man für jede Datei (bei mir zur Zeit viel HTML) ein eigenes Textastic-Fenster öffnen. Hab schon was von Tabs bzw. einer hierarchischen Liste gelesen. Das ist aus meiner Sicht mit was Wichtigste nächste Feature für diesen jetzt schon sehr guten Editor. Weiter so! :)

Danke! Beim letzten Video konnte ich es jetzt gerade tatsächlich auf meinem Macbook Pro nachstellen! Seltsam, dass das vorher nicht geklappt hat.


Aber nun hab ich einen Anhaltspunkt, an was es liegen könnte. Ich versuche, das Problem zu beheben!


Und ja: Tabs sind Top-Priorität - das vermisse ich selbst auch am meisten.

Ich denke, ich konnte das Problem beheben: beim Ändern der Syntax-Definition hatte ich bisher auch dem System einen neuen "FileType" mitgeteilt. Das hat dazu geführt, dass die Datei umbenannt wurde.


In iCloud und der eigenen Sandbox geht das auch ohne Probleme, außerhalb der Sandbox hat das aber dazu geführt, dass eine Datei geschrieben werden sollte, auf die die App keinen Zugriff hat.


Jetzt habe ich es so geändert, dass nur noch bei "Untitled"-Dateien, die noch nicht gespeichert wurden der Datei-Typ dem System mitgeteilt wird. Dadurch finden kein Umbenennen mehr statt und es gibt kein Sandboxing-Problem.

Ha, geil!

Hat sich die Hartnäckigkeit doch ausgezahlt.

Vielen vielen Dank dafür. Ich freue mich auf das Update. Weißt du schon, wann es auf den Weg geht? Dauert ja auch alles ein wenig ...

Ich möchte erst noch ein paar andere Dinge, die in den letzten Tagen aufgetaucht sind umsetzen.

Ok, verständlich.

Dann warte ich geduldig. :)


Danke noch mal ...

I ran into this problem also yesterday:

  1. Created new doc
  2. Pasted in some code
  3. Switched to browser to look up something
  4. When I came back saw the "could not autosave file, you don't have permissions"
  5. Went and looked at the file permissions - they were fine, but anyway gave everyone RW permissions - didn't help
  6. Finally just copied the code, open the file in another editor, and was able to save

So you just created a new untitled document and didn't even save or change the syntax definition when this happened?

Answer
Fixed

This problem should be fixed in Textastic 2.0 which is now available on the Mac App Store.