Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I face the same issue eight years after the question was initially asked, while using Sage Version 5.9-OSX-64bit-10.8. I am using init.sage for the first time, and every time a notebook is opened, two files are created in the .sage directory with names like init.sageCfCKee and init.sageCfCKee.py. The mulitiple copies quickly obscure everything else in the folder. Surely these files are supposed to go into the tmp or temp directories. Perhaps I have somehow corrupted my Sage setup, but for now my quick solution is to add the following two lines to the beginning of my init.sage file:

from subprocess import call
call("rm -f /Users/davidbailey/.sage/init.sage?*", shell=True)

This deletes the two offending files before any of the other init.sage commands are executed.

I am uncomfortable doing "rm -f" in any program, and I am concerned that deleting the two files will cause some problem, but so far I haven't notice anything.

click to hide/show revision 2
Made answer slightly more general.

I face the same issue eight years after the question was initially asked, while using Sage Version 5.9-OSX-64bit-10.8. I am using init.sage for the first time, and every time a notebook is opened, two files are created in the .sage directory with names like init.sageCfCKee and init.sageCfCKee.py. The mulitiple copies quickly obscure everything else in the folder. Surely these files are supposed to go into the tmp or temp directories. Perhaps I have somehow corrupted my Sage setup, but for now my quick solution is to add the following two lines to the beginning of my init.sage file:

from subprocess import call
call("rm -f /Users/davidbailey/.sage/init.sage?*", /Users/davidbailey/.sage/*.sage?*", shell=True)

This deletes the two offending files before any of the other init.sage commands are executed.executed. It also deletes any other such files created by load/attach commands. These lines can be added to any .sage file that is creating such duplicates.

I am uncomfortable doing "rm -f" in any program, and I am concerned that deleting the two files will cause some problem, but so far I haven't notice noticed anything.

WARNING: This deletes any files ending in .sageX, where X is one or more characters. So if you save a file with an ending like .sage1, it will be deleted. Use at your own risk.

I face the same issue eight years after the question was initially asked, while using Sage Version 5.9-OSX-64bit-10.8. I am using init.sage for the first time, and every time a notebook is opened, two files are created in the .sage directory with names like init.sageCfCKee and init.sageCfCKee.py. The mulitiple copies quickly obscure everything else in the folder. Surely these files are supposed to go into the tmp or temp directories. Perhaps I have somehow corrupted my Sage setup, but for now my quick solution on my OS X Mac is to add the following two lines to the beginning of my init.sage file:

from subprocess import call
call("rm -f /Users/davidbailey/.sage/*.sage?*", /Users/username/.sage/init.sage?*", shell=True)

This deletes the two offending files before any of the other init.sage commands are executed. It also deletes any I include a similar two lines at the beginning of other such files created .sage files that I want to attach or load, but with "init" replaced by load/attach commands. the name of that file. These lines can be added to any .sage file that is creating such duplicates.duplicates. (Note:"/Users/username/.sage" should be replaced the location of your own .sage file.)

WARNING: I am uncomfortable doing "rm -f" in any program, and I am concerned that deleting the two files will cause some problem, but so far I haven't noticed anything.

WARNING: This deletes any files ending in .sageX, where X is one or more characters. So anything. Be careful, since if you save make a file with an ending like .sage1, it will be deleted. typing mistake (e.g. forget the "?"), you might delete something you want to keep. Use at your own risk.

I face the same issue eight years after the question was initially asked, while using Sage Version 5.9-OSX-64bit-10.8. I am using init.sage for the first time, and every time a notebook is opened, two files are created in the .sage directory with names like init.sageCfCKee and init.sageCfCKee.py. The mulitiple copies quickly obscure everything else in the folder. Surely these files are supposed to go into the tmp or temp directories. Perhaps I have somehow corrupted my Sage setup, but for now my quick solution on my OS X Mac is to add the following two lines to the beginning of my init.sage file:

from subprocess import call
call("rm -f /Users/username/.sage/init.sage?*", shell=True)

This deletes the two offending files before any of the other init.sage commands are executed. I include a similar two lines at the beginning of other .sage files that I want to attach or load, but with "init" replaced by the name of that file. These lines can be added to any .sage file that is creating such duplicates. (Note:"/Users/username/.sage" should be replaced by the location of your own .sage file.)

WARNING: I am uncomfortable doing "rm -f" in any program, and I am concerned that deleting the two files will cause some problem, but so far I haven't noticed anything. Be careful, since if you make a typing mistake (e.g. forget the "?"), you might delete something you want to keep. Use at your own risk.