paths
RemotePath
RemotePath is used to model a remote path, it takes inspiration from pathlib
and shares some of its interface.
date = Field(None, title='Date')
class-attribute
instance-attribute
group = Field(None, title='Group')
class-attribute
instance-attribute
hardlinks = Field(0, title='Hardlinks')
class-attribute
instance-attribute
name = Field(None, title='Name')
class-attribute
instance-attribute
perms = Field(None, title='Perms')
class-attribute
instance-attribute
size = Field(0, title='Size')
class-attribute
instance-attribute
user = Field(None, title='User')
class-attribute
instance-attribute
RemotePath is used to model a remote path, it takes inspiration from pathlib and shares some of its interface.
Source code in sfapi_client/_sync/paths.py
compute
instance-attribute
date = Field(None, title='Date')
class-attribute
instance-attribute
group = Field(None, title='Group')
class-attribute
instance-attribute
hardlinks = Field(0, title='Hardlinks')
class-attribute
instance-attribute
name = self._path.name
instance-attribute
parent
property
parents
property
parts
property
perms = Field(None, title='Perms')
class-attribute
instance-attribute
size = Field(0, title='Size')
class-attribute
instance-attribute
stem
property
suffix
property
suffixes
property
user = Field(None, title='User')
class-attribute
instance-attribute
dict(*args, **kwargs)
download(binary=False)
Download the file contents.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
binary
|
indicate if the file should be treated as binary, defaults to False |
False
|
Raises:
Type | Description |
---|---|
IsADirectoryError
|
if path points to a directory. |
SfApiError
|
|
Source code in sfapi_client/_sync/paths.py
is_dir()
Returns:
Type | Description |
---|---|
bool
|
Returns True if path is a directory, False otherwise. |
is_file()
ls()
open(mode)
Open the file at this path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
The mode to open the file. Valid options are 'rwb'. raises: IsDirectoryError: If the path is not a file. |
required |
Source code in sfapi_client/_sync/paths.py
update()
Update the path in the latest information from the resource.