Skip to content

filesystem

messageflux.utils.filesystem

AtomicMoveException

AtomicMoveException(*args, **kwargs)

Bases: KwargsException

an exception which is raised when atomic move fails

atomic_move

atomic_move(src, dest, lock_filename)

moves a file atomically (hopefully) from src to dest, using lock_filename as lockfile

Parameters:

Name Type Description Default
src str

the source file path

required
dest str

the destination file path

required
lock_filename str

the lockfile path

required

Returns:

Type Description
bool

True if succeeded, False otherwise

recursive_chmod

recursive_chmod(dir_name)

chmods to 0o777 the directory and its directory tree

Parameters:

Name Type Description Default
dir_name str

the dir to chmod

required