diff --git a/warden3/contrib/warden_filer/README b/warden3/contrib/warden_filer/README index e1250acbf6cee7086e764a33b15672b4ec661980..6d70f03b66286fa27d99baa0affe0f6fb4130b74 100644 --- a/warden3/contrib/warden_filer/README +++ b/warden3/contrib/warden_filer/README @@ -135,11 +135,11 @@ directories must obey simple protocols, which use atomic "rename" to avoid locking issues. Also, your directory (and its structure) _must_ reside on the same filesystem to keep "rename" atomic. _Never_ try to mount some of the -subdirectories ("temp", "incoming", "errors") from other filesystem. +subdirectories ("tmp", "incoming", "errors") from other filesystem. 1. Inserting file - * The file you want to create _must_ be created in the "temp" subdirectory + * The file you want to create _must_ be created in the "tmp" subdirectory first, _not_ "incoming". Filename is arbitrary, but must be unique among all subdirectories. @@ -148,7 +148,7 @@ subdirectories ("temp", "incoming", "errors") from other filesystem. or complete. For simple usage (bash scripts, etc.), just creating sufficiently random - filename in "temp" and then moving into "incoming" may be enough. + filename in "tmp" and then moving into "incoming" may be enough. Concatenating $RANDOM couple of times will do. :) For advanced or potentially concurrent usage inserting enough of unique @@ -159,7 +159,7 @@ subdirectories ("temp", "incoming", "errors") from other filesystem. 2. Picking up file - * Rename the file to work with into "temp" directory. + * Rename the file to work with into "tmp" directory. * Do whatever you want with contents, and when finished, rename file back into "incoming", or remove, or move somewhere else, or move into "errors" diff --git a/warden3/contrib/warden_filer/warden_filer.py b/warden3/contrib/warden_filer/warden_filer.py index b9d08cb376dbb3f474c48f79afb123bb643f1b1d..9ed1fbc573cc8f0aa2469f2d6e8c05bb604c42fe 100755 --- a/warden3/contrib/warden_filer/warden_filer.py +++ b/warden3/contrib/warden_filer/warden_filer.py @@ -65,9 +65,9 @@ class NamedFile(object): class SafeDir(object): """ Maildir like directory for safe file exchange. - - Producers are expected to drop files into "temp" under globally unique + - Producers are expected to drop files into "tmp" under globally unique filename and rename it into "incoming" atomically (newfile method) - - Workers pick files in "incoming", rename them into "temp", + - Workers pick files in "incoming", rename them into "tmp", do whatever they want, and either discard them or move into "errors" directory """ @@ -76,7 +76,7 @@ class SafeDir(object): self.path = self._ensure_path(p) self.incoming = self._ensure_path(path.join(self.path, "incoming")) self.errors = self._ensure_path(path.join(self.path, "errors")) - self.temp = self._ensure_path(path.join(self.path, "temp")) + self.temp = self._ensure_path(path.join(self.path, "tmp")) self.hostname = socket.gethostname() self.pid = os.getpid() @@ -116,7 +116,7 @@ class SafeDir(object): # which checked uniqueness among all directories by atomic # links. - # First find and open name unique within temp + # First find and open name unique within tmp tmpname = None while not tmpname: tmpname = self._get_new_name()