also, I'll just mention my other trick for manually digging through 
temporary sage outputs: sort by creation date instead of name

On Tuesday, July 1, 2014 1:06:18 PM UTC-4, Niles Johnson wrote:
>
>
>
>
> On Tuesday, July 1, 2014 12:45:57 PM UTC-4, Nils Bruin wrote:
>>
>>  
>> It probably was intended. As a general rule, temporary files live in 
>> directories where multiple entities have file creation privileges, 
>> including ones that don't necessarily trust each other fully. If you're 
>> creating filenames via a predictable pattern, you're vulnerable to a denial 
>> of service, since an adversary might try and predict which file you're 
>> going to try and create next and do that before you.
>>
>
> This is my understanding too
>  
>
>> What you're describing is a situation where the files weren't intended to 
>> be temporary after all--apparently they're output. The proper solution is 
>> of course to save your plots instead:
>>
>>
> If you want to save and view this output in a temporary directory, you can 
> get one with tmp_dir [1].  And, if you want the old functionality, you can 
> use graphics_filename [2].  Note that the latter isn't automatically 
> imported to the global namespace, so you need to do it manually.  A simple 
> way would be
>
> from sage.misc.temporary_file import graphics_filename as gf
>
> And then use it like this:
>
> for i in range(10):
>     plot(sin(i*x),-1,1).save(gf())
>
>
>
> [1] 
> http://www.sagemath.org/doc/reference/misc/sage/misc/temporary_file.html#sage.misc.temporary_file.tmp_dir
>
> [2] 
> http://www.sagemath.org/doc/reference/misc/sage/misc/temporary_file.html#sage.misc.temporary_file.graphics_filename
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to