Package winappdbg :: Module util :: Class PathOperations
[hide private]
[frames] | no frames]

Class PathOperations

source code


Static methods for filename and pathname manipulation.

Instance Methods [hide private]

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
bool
path_is_relative(path)
Returns: True if the path is relative, False if it's absolute.
source code
bool
path_is_absolute(path)
Returns: True if the path is absolute, False if it's relative.
source code
str
make_relative(path, current=None)
Returns: Relative path.
source code
str
make_absolute(path)
Returns: Absolute path.
source code
tuple( str, str )
split_extension(pathname)
Returns: Tuple containing the file and extension components of the filename.
source code
tuple( str, str )
split_filename(pathname)
Returns: Tuple containing the path to the file and the base filename.
source code
list( str... )
split_path(path)
Returns: List of path components.
source code
str
join_path(*components)
Returns: Absolute or relative path.
source code
str
native_to_win32_pathname(name)
Returns: Win32 absolute pathname.
source code
str
pathname_to_filename(pathname)
Equivalent to: PathOperations.split_filename(pathname)[0]
source code
a new object with type S, a subtype of T
__new__(cls, *argv, **argd)
Don't try to instance this class, just use the static methods. (Inherited from winappdbg.util.StaticClass)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

path_is_relative(path)
Static Method

source code 
Parameters:
  • path (str) - Absolute or relative path.
Returns: bool
True if the path is relative, False if it's absolute.

See Also: path_is_absolute

path_is_absolute(path)
Static Method

source code 
Parameters:
  • path (str) - Absolute or relative path.
Returns: bool
True if the path is absolute, False if it's relative.

See Also: path_is_relative

make_relative(path, current=None)
Static Method

source code 
Parameters:
  • path (str) - Absolute path.
  • current (str) - (Optional) Path to the current directory.
Returns: str
Relative path.
Raises:
  • WindowsError - It's impossible to make the path relative. This happens when the path and the current path are not on the same disk drive or network share.

make_absolute(path)
Static Method

source code 
Parameters:
  • path (str) - Relative path.
Returns: str
Absolute path.

split_extension(pathname)
Static Method

source code 
Parameters:
  • pathname (str) - Absolute path.
Returns: tuple( str, str )
Tuple containing the file and extension components of the filename.

split_filename(pathname)
Static Method

source code 
Parameters:
  • pathname (str) - Absolute path.
Returns: tuple( str, str )
Tuple containing the path to the file and the base filename.

split_path(path)
Static Method

source code 
Parameters:
  • path (str) - Absolute or relative path.
Returns: list( str... )
List of path components.

See Also: join_path

join_path(*components)
Static Method

source code 
Parameters:
  • components (tuple( str... )) - Path components.
Returns: str
Absolute or relative path.

See Also: split_path

native_to_win32_pathname(name)
Static Method

source code 
Parameters:
  • name (str) - Native (NT) absolute pathname.
Returns: str
Win32 absolute pathname.

pathname_to_filename(pathname)
Static Method

source code 

Equivalent to: PathOperations.split_filename(pathname)[0]

Parameters:
  • pathname (str) - Absolute path to a file.
Returns: str
Filename component of the path.

Note: This function is preserved for backwards compatibility with WinAppDbg 1.4 and earlier. It may be removed in future versions.