Teradata Package for Python Function Reference - 17.00 - remove_file - Teradata Package for Python
Teradata® Package for Python Function Reference
- Teradata Package for Python
- Release Number
- Release Date
- April 2021
- Content Type
- Programming Reference
- Publication ID
- English (United States)
- filemgr.remove_file = remove_file(file_identifier, force_remove)
Function to remove user installed files/scripts from Vantage.
Specifies the name associated with the user-installed file.
It cannot have a database name associated with it,
as the file is always installed in the current database.
Specifies if system should check for the file being used before removing it.
If set to True, then the file is removed even if it is being executed.
If set to False, then an error is thrown if it is being executed.
Default Value: False
True, if success.
# Run install_file example before removing file.
# Note: File can be on client or remote server. The file location should be specified accordingly.
# Example 1: Install the file mapper.py found at the relative path data/scripts/ using the default
# text mode.
>>> install_file (file_identifier='mapper', file_location='data/scripts/mapper.py')
File mapper.py installed in Vantage
# Example 2: Install the file binary_file.dms found at the relative path data/scripts/
# using the binary mode.
>>> install_file (file_identifier='binaryfile', file_location='data/scripts/binary_file.dms', file_on_client = True, is_binary = True)
File binary_file.dms installed in Vantage
# Remove the installed files.
# Example 1: Remove text file
>>> remove_file (file_identifier='mapper', force_remove=True)
File mapper removed from Vantage
# Example 2: Remove binary file
>>> remove_file (file_identifier='binaryfile', force_remove=False)
File binaryfile removed from Vantage