← Back to team overview

instant team mailing list archive

Re: Lock files

 

On Fri, Apr 24, 2009 at 2:58 PM, Ilmar Wilbers <ilmarw@xxxxxxxxx> wrote:
> I noticed that the .lock files not always are written to the Instant
> cache, but are found in the same location as the cache_dir argument,
> although the module in fact does not end up there. Particularely when
> using the argument modulename, the .lock file ends up in the directory
> specified by cache_dir although the module directory ends up in pwd. Is
> this behaviour intended?

The modulename is intended for placing the module outside the cache
in a fixed directory. So the lock file should then be placed somewhere else,
since we don't know if the user can access the cache directory.
Either we don't need lock files for manually specified module directories,
or it should be placed locally, i.e. in pwd.

> When importing a module by the module name, we get an error if we don't
> have write access to the directory in cache_dir:
> m = instant.import_module('instant_ext', '/usr')
> IOError: [Errno 13] Permission denied: '/usr/instant_ext.lock'
>
> I'm not saying this isn't right, I just wondered if this is the way it
> should be.

Why would you want to specify a cache_dir you can't write to? I say that's ok.

Martin


Follow ups

References