rslinckx/simplekv — comment on commit a738e65a7d1f07ce9f38d7a54a2dccd90ce55dd7
File:  line 0
By mbr:

This may be a valid concern, however, I'm not 100% sure of it yet. How many temporary directories does one use in the average case?

My initial use case (without idgen) for put_filename was handling file uploads that have been saved by nginx to a temporary directory and passed to a wsgi app as a filename. In this case, the file already is in the temporary directory, this is similiar to using the idgen as a decorator.

The temporary directory can be configured by the user through the standard environment variables (see http://docs.python.org/library/tempfile.html#tempfile.mkstemp), this should prevent some issues from occuring.

I can only think of a few setups with multiple instances of FilesystemStore that would require multiple temporary directories. In case of a single temporary directory, you can set the mentioned environment variable. If your temporary directory needs to be on the source-filesystem store, we need a better get_file, that takes advantages of filesystems that support COW and similiar things. So basically, we do need two filesystem stores that information is written to (not only read from!), on different filesystems.

But finally: Does the idiom of using SimpleKV.open() and passing the resulting file-like object to put_file() not solve the issue and not write temporary files at all?