Package elisa :: Package core :: Package utils :: Module path_utils

Module path_utils

source code

Functions
bool
have_file_sync(file_path)
Check whether a file exists and is non empty.
source code
twisted.internet.defer.Deferred
have_file(file_path)
Check whether a file exists and is non empty.
source code

Imports: os, threads


Function Details

have_file_sync(file_path)

source code 

Check whether a file exists and is non empty.

You should prefer have_file(), its non-blocking version.

Parameters:
  • file_path (unicode) - the path of the file to check for existence
Returns: bool
True if the file exists and is not empty, False otherwise

have_file(file_path)

source code 

Check whether a file exists and is non empty.

Note: the returned deferred is not cancellable

Parameters:
  • file_path (unicode) - the path of the file to check for existence
Returns: twisted.internet.defer.Deferred
Whether the file exists and is non empty (in a deferred)