Ask Your Question

How to delete output file for rewriting?

asked 2014-01-12 16:52:09 -0500

corleymj gravatar image

updated 2014-01-13 20:08:52 -0500

I am using the Python's wave library to create some simple .wav files. It is impossible to overwrite these files, so I need a way to delete them before I run the code to create them. Right now, I am having to rename the file every time. There must be a simple way to delete the files in Terminal but I can't seem to find them. I am creating the files via the Notebook GUI. Any clues where the files could be saved or know of any other way to delete them?

edit retag flag offensive close merge delete


Not sure why someone down voted this...

kcrisman gravatar imagekcrisman ( 2014-01-13 03:19:54 -0500 )edit

Thanks for the renaming - this will probably end up being useful for many other users!

kcrisman gravatar imagekcrisman ( 2014-01-14 01:41:09 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-01-13 03:27:43 -0500

kcrisman gravatar image

If you can give a very simple example that would be helpful. I'm not sure why your program wouldn't simply overwrite them, but I am not familiar with the wave library. It should certainly be possible in the notebook itself. But here is the generic answer for the Terminal, since that doesn't seem to be working:

First, a sample in the Terminal:

$ ls .sage/sage_notebook.sagenb/home/admin/215/cells/13/   sage0-size500.jmol
$ rm ./sage/sage_notebook.sagenb/home/admin/215/cells/13/sage0-size500.jmol


  • Find the number of the worksheet you are looking at. This should be in the URL for the worksheet.
  • Find the correct folder for the worksheet. That should be, normally, in a URL of the form above like .sage/sage_notebook.sagenb/home/admin/# but it could change based on the DOT_SAGE environment variable and whether you are the default user. Permissions could conceivably be an issue in that case.
  • Look at the files in that worksheet's cells. See the example. You can see what cell the file lives in by using the "Edit" button, I think - there should be a tag there.
  • Remove the file in question.
edit flag offensive delete link more


+1 for helping us locate these output files! ...unfortunately, that did not solve the problem that both the OP and I were having. I just discovered that the files were indeed getting overwritten with new ones. That wasn't the problem. The problem was that we were playing these sound files from the broswer/notebook. So, even though the files had changed on disk, the browser is playing a cached version of them. It's really annoying because it does this even after hitting the refresh button. If I play the files from the command line, in the location you specified, using a command line player like `play` from sox, they play just fine.

williamdemeo gravatar imagewilliamdemeo ( 2014-01-15 19:09:22 -0500 )edit

Caching. Yuck. There is something called a "hard refresh", though, and that should solve the problem in this case. Good luck!

kcrisman gravatar imagekcrisman ( 2014-01-20 09:54:23 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2014-01-12 16:52:09 -0500

Seen: 189 times

Last updated: Jan 13 '14