First time here? Check out the FAQ!

Ask Your Question
1

How to delete output file for rewriting?

asked 11 years ago

corleymj gravatar image

updated 11 years ago

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?

Preview: (hide)

Comments

Not sure why someone down voted this...

kcrisman gravatar imagekcrisman ( 11 years ago )

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

kcrisman gravatar imagekcrisman ( 11 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 11 years ago

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-1046860989.jmol.zip   sage0-size500.jmol
$ rm ./sage/sage_notebook.sagenb/home/admin/215/cells/13/sage0-size500.jmol
$

Steps:

  • 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.
Preview: (hide)
link

Comments

+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 ( 11 years ago )

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

kcrisman gravatar imagekcrisman ( 11 years ago )

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 11 years ago

Seen: 705 times

Last updated: Jan 14 '14