Ask Your Question
1

How to delete output file for rewriting?

asked 2014-01-12 23:52:09 +0100

corleymj gravatar image

updated 2014-01-14 03:08:52 +0100

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

Comments

Not sure why someone down voted this...

kcrisman gravatar imagekcrisman ( 2014-01-13 10:19:54 +0100 )edit

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

kcrisman gravatar imagekcrisman ( 2014-01-14 08:41:09 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-01-13 10:27:43 +0100

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.
edit flag offensive delete link more

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 ( 2014-01-16 02:09:22 +0100 )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 16:54:23 +0100 )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

Stats

Asked: 2014-01-12 23:52:09 +0100

Seen: 665 times

Last updated: Jan 14 '14