File: //usr/lib/python3/dist-packages/duplicity/__pycache__/path.cpython-310.pyc
o
�wa;r � @ s\ d Z ddlmZ ddlmZ e�� ddlmZ ddlmZ ddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlT dZdaG dd� de�ZG dd� de�Z G dd� de�Z!G dd� de!�Z"G dd� de"�Z#G dd� de$�Z%dS )z�Wrapper class around a file like "/usr/bin/env"
This class makes certain file operations more convenient and
associates stat information with filenames
� )�print_function)�standard_library)�str)�objectN)�
cached_ops)�config)�dup_time)�file_naming)�gpg)�librsync)�log)�tarfile)�util)�*i � c @ s e Zd ZdZdZdS )�
StatResultz3Used to emulate the output of os.stat() and relatedr N)�__name__�
__module__�__qualname__�__doc__�st_mode� r r �0/usr/lib/python3/dist-packages/duplicity/path.pyr ; s r c @ s e Zd ZdS )�
PathExceptionN)r r r r r r r r B s r c @ s� e Zd ZdZd>dd�Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Zd'd(� Zd)d*� Zd+d,� Zd-d.� Zd/d0� Zd?d2d3�Zd4d5� Zd6d7� Zd8d9� Zd:d;� Zd<d=� Z dS )@�ROPathz�Read only Path
Objects of this class doesn't represent real files, so they don't
have a name. They are required to be indexed though.
Nc C s. d\| _ | _|| _d\| _| _d\| _| _dS )zROPath initializer�NNN)�opened�fileobj�index�stat�type�mode�devnums)�selfr r r r r �__init__M s zROPath.__init__c
C s | j sd| _| j j}t �|�rd| _nAt �|�rd| _n8t �|�r%d| _n/t �|�r.d| _n&t �|�r>tt �
| �� �d ��t �|�rGd| _n
t �
|�rPd | _ntd
��t �|�| _| jdv r�zt�| j j�t�| j j�f| _W dS t�td�t �
| �� �| j jf � d
| _Y dS dS )z4Set the value of self.type, self.mode from self.statN�reg�dir�sym�fifozis a socket, unsupported by tar�sock�chr�blkzUnknown type)r* r+ z7Warning: %s invalid devnums (0x%X), treating as (0, 0).�r r )r r r �S_ISREG�S_ISDIR�S_ISLNK�S_ISFIFO�S_ISSOCKr r �fsdecode�get_relative_path�S_ISCHR�S_ISBLK�S_IMODEr! �os�major�st_rdev�minorr"