Filesystem represents abstract API definition. It is now implemented by conu.DockerContainerFS
Utility methods used to access filesystem of containers and images.
Implementations should probably be done using context managers.
Parameters: |
|
---|
copy a file or a directory from container or image to host system. If you are copying directories, the target directory must not exist (this function is using shutil.copytree to copy directories and that’s a requirement of the function). In case the directory exists, OSError on python 2 or FileExistsError on python 3 are raised.
Parameters: |
|
---|---|
Returns: | None |
copy a file or a directory from host system to a container – don’t implement for images, those are immutable
Parameters: |
|
---|---|
Returns: | None |
check if directory ‘directory_path’ is present, raise IOError if it’s not a directory
Parameters: | directory_path – str, directory to check |
---|---|
Returns: | True if directory exists, False if directory does not exist |
check if file ‘file_path’ is present, raises IOError if file_path is not a file
Parameters: | file_path – str, path to the file |
---|---|
Returns: | True if file exists, False if file does not exist |
provide File object specified via ‘file_path’
Parameters: |
|
---|---|
Returns: | File instance |
return a permissions for ‘file_path’
Parameters: | file_path – str, path to the file |
---|---|
Returns: | str |
provide absolute path within the container
Parameters: | path – path with container |
---|---|
Returns: | str |
read file specified via ‘file_path’ and return its content - raises an ConuException if there is an issue accessing the file
Parameters: | file_path – str, path to the file to read |
---|---|
Returns: | str (not bytes), content of the file |