Logical File Script python reference

Logicalfile management functions.

lmi.scripts.logicalfile.logicalfile.get_directory_instance(ns, directory)

Retrieve LMIInstance of a directory.

Parameters:directory (string) – Full path to the directory.
Return type:LMIInstance
lmi.scripts.logicalfile.logicalfile.get_directory_name_properties(ns, directory)

Retrieve object path of a directory.

Parameters:directory (string) – Full path to the directory.
Return type:LMIInstanceName
lmi.scripts.logicalfile.logicalfile.get_file_identification(file_instance)

Retrieve file identification.

Parameters:file_instance (LMIInstance) – The file’s instance object.
Return type:string
lmi.scripts.logicalfile.logicalfile.lf_createdir(ns, directory)

Create a directory.

The parent directory must exist.

Parameters:directory (string) – Full path to the directory.
lmi.scripts.logicalfile.logicalfile.lf_deletedir(ns, directory)

Delete a directory.

The directory must be empty.

Parameters:directory (string) – Full path to the directory.
lmi.scripts.logicalfile.logicalfile.lf_list(ns, directory, depth=None)

List all files in a directory.

If depth is positive, directory is walked recursively up to the given depth.

Parameters:
  • directory (string) – Full path to the directory.
  • depth (integer) – Maximum depth to be recursed to.
lmi.scripts.logicalfile.logicalfile.lf_show(ns, target)

Show detailed information about the target.

Target can be either a file or a directory.

Parameters:target (string) – Full path to the target.
lmi.scripts.logicalfile.logicalfile.walk_cim_directory(directory, depth=0)

Retrieve all files in a directory.

If depth is positive, directory is walked recursively up to the given depth. Files and directories are yielded as they are encountered. This function does not return, it is a generator.

Parameters:
  • directory (string) – Full path to the directory.
  • depth (integer) – Maximum depth to be recursed to.