Module eoxserver.core.util.filetools

This module contains utility functions for file operations.

eoxserver.core.util.filetools.findFiles(dir, pattern)

This function mimicks the behaviour of the find shell command. It expects a directory path dir and a file name pattern pattern which may contain wildcards as accepted by the fnmatch.fnmatch() function. It returns a list of paths to matching files in dir and its subdirectories.

If dir does not exist or does not point to a directory or if no matching files are found an empty list is returned.

Directories and files whose name starts with ”.” are omitted.

eoxserver.core.util.filetools.pathToModuleName(path)

This function takes a module path path as argument and returns the corresponding dotted name of the module.

class eoxserver.core.util.filetools.TmpFile(suffix, prefix='')

temporary file object - with - as statement friendly

__str__()

Converts class to name of the temporary file.

__enter__()

Begin of with - as block - returns name of the temporary file.

__exit__(type, value, traceback)

End of with - as block - discards the temporary file.