- Open a terminal window (Applications/Utilities/Terminal)
- Change the current folder to the target folder (myfolder)
- If you want to create the target file (myfile)
- Type: sudo touch myfile
- Authenticate with the admin password
- If the folder is hidden in Finder, show hidden files in Finder
- Find and enter myfolder in Finder
- Drag and drop myfile from myfolder to the Desktop
- Edit myfile from the Desktop with any editor
- Save the file to the Desktop
- Drag and drop myfile from the Desktop to myfolder
- When asked, choose Replace
- Authenticate with the admin password
How to access hidden files and folders in Finder
- (Download, install and) run the TinkerTool
- Select the Finder panel
- Among the Finder options, tick Show hidden and system files
- At the bottom right, click on Relaunch Finder
How to fix Fatal error: Exception thrown without a stack frame
From time to time I get the infamous
Fatal error: Exception thrown without a stack frame in Unknown on line 0
but googling about it yesterday I found this article that describes a method for seeing through it and discover the real error. It’s very simple and yet powerful (and it works).
The key trick is
- find the line N where your script is misbehaving. This is tedious but easily done with a binary search on the execution line. At the beginning, the execution line can be that of the whole script.
- find an approximate middle point in the current execution line
- put an exit instruction there and execute the script again
- do you get the same error?
- YES: make the executed half the next execution line
- NO: make the non executed half the next execution line
- remove the exit
- repeat all until the exit on line N is clean and on line N+1 is dirty
- look at what you have on line N and try to figure out how to force your script to willfully do right there the same operations that are automatically done on shut down
- in my case yesterday, like the author of the article, I had a session_start on line N, so that I added a session_write_close() on line N+1 and an exit on line N+2. Magically the real error message got displayed!!