sorcha.utilities.fileAccessUtils

Functions

FindFileOrExit(arg_fn, argname)

Checks to see if a file given by a filename exists. If it doesn't,

FindDirectoryOrExit(arg_fn, argname)

Checks to see if a directory given by a filepath exists. If it doesn't,

Module Contents

FindFileOrExit(arg_fn, argname)[source]

Checks to see if a file given by a filename exists. If it doesn't, this fails gracefully and exits to the command line.

Parameters:
  • arg_fn (string) -- The filepath/name of the file to be checked.

  • argname (string) -- The name of the argument being checked. Used for error message.

Returns:

arg_fn -- The filepath/name of the file to be checked.

Return type:

string

FindDirectoryOrExit(arg_fn, argname)[source]

Checks to see if a directory given by a filepath exists. If it doesn't, this fails gracefully and exits to the command line.

Parameters:
  • arg_fn (string) -- The filepath of the directory to be checked.

  • argname (string) -- The name of the argument being checked. Used for error message.

Returns:

arg_fn -- The filepath of the directory to be checked.

Return type:

string