+
    &j?                         ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIHtHt ^ RIt^RI	H
t
 ^RIHt ]P                  ! R4      t ! R R]
4      tR tR	 tR# )
    N)S_ISDIRS_ISLNK)AbstractFileSysteminfer_storage_optionszfsspec.sftpc                      a a ] tR t^t oRtRtV 3R ltR t]R 4       t	]
R 4       tRR ltRR ltR tR	 t]
RR
 l4       tRR ltRR ltR tRR ltR tR tRtVtV ;t# )SFTPFileSystemzFiles over SFTP/SSH

Peer-to-peer filesystem over SSH using paramiko.

Note: if using this with the ``open`` or ``open_files``, with full URLs,
there is no way to tell if a path is relative, so all paths are assumed
to be absolute.
c                   < V P                   '       d   R# \        SV `  ! R/ VB  VP                  RR4      V n        Wn        W n        V P                  4        R# )a]  

Parameters
----------
host: str
    Hostname or IP as a string
temppath: str
    Location on the server to put files, when within a transaction
ssh_kwargs: dict
    Parameters passed on to connection. See details in
    https://docs.paramiko.org/en/3.3/api/client.html#paramiko.client.SSHClient.connect
    May include port, username, password...
Ntemppathz/tmp )_cachedsuper__init__popr   host
ssh_kwargs_connect)selfr   r   	__class__s   &&,s/Users/jameslopez/projects/CWCArchive/cwc-podcast/.venv/lib/python3.14/site-packages/fsspec/implementations/sftp.pyr   SFTPFileSystem.__init__   sF     <<<&:&"z6:	$    c                v   \         P                  R V P                  4       \        P                  ! 4       V n        V P
                  P                  \        P                  ! 4       4       V P
                  P                  ! V P                  3/ V P                  B  V P
                  P                  4       V n        R# )zConnecting to SFTP server %sN)loggerdebugr   paramiko	SSHClientclientset_missing_host_key_policyAutoAddPolicyconnectr   	open_sftpftpr   s   &r   r   SFTPFileSystem._connect2   ss    3TYY?((*//0F0F0HIDII99;;((*r   c                &    \        V4      R ,          # )pathr   )clsr'   s   &&r   _strip_protocolSFTPFileSystem._strip_protocol9   s    $T*622r   c                d    \        V 4      pVP                  R R4       VP                  RR4       V# )r'   Nprotocol)r   r   )urlpathouts   & r   _get_kwargs_from_urls$SFTPFileSystem._get_kwargs_from_urls=   s-    #G,
D!
r   c                
   V P                  V4      p\        P                  R V4       V P                  V4      '       d   \	        RV 24      hV'       d   V P                  V4       R# V P                  P                  W4       R# )zCreating folder %sFile exists: N)r)   r   r   existsFileExistsErrormakedirsr#   mkdir)r   r'   create_parentsmodes   &&&&r   r6   SFTPFileSystem.mkdirD   sa    ##D))40;;t!M$"899MM$HHNN4&r   c                V   V P                  V4      '       d   V'       g   \        R V 24      hVP                  R4      pVR,          R8X  d   RMRpV FR  pV'       g   K  V'       d   V RV 2MTpV P                  V4      '       d   K7  V P                  P	                  WS4       KT  	  R# )r2   /:N   N N)r3   r4   splitr#   r6   )r   r'   exist_okr8   partsnew_pathparts   &&&&   r   r5   SFTPFileSystem.makedirsO   s    ;;tX!M$"899

3r(c/3rDt3;hZq/{{8,,HHNN82	 r   c                    V P                  V4      p\        P                  R V4       V P                  P	                  V4       R# )zRemoving folder %sN)r)   r   r   r#   rmdirr   r'   s   &&r   rE   SFTPFileSystem.rmdir\   s1    ##D))40tr   c                    V P                  V4      pV P                  V P                  P                  V4      4      pWR &   V# )name)r)   _decode_statr#   stat)r   r'   rK   s   && r   infoSFTPFileSystem.infoa   s;    ##D)  t!45Vr   c                P   \        V P                  4      '       d   R pM \        V P                  4      '       d   RpMRpRRRV P                  RVRV P                  RV P
                  R	\        P                  P                  V P                  \        P                  P                  R
7      R\        P                  P                  V P                  \        P                  P                  R
7      /pV'       d0   RP                  VP                  R4      V P                  .4      VR&   V# )	directorylinkfilerI   r=   sizetypeuidgidtime)tzmtimer;   )r   st_moder   st_sizest_uidst_giddatetimefromtimestampst_atimetimezoneutcst_mtimejoinrstripfilename)rK   parent_pathtr.   s   &&  r   rJ   SFTPFileSystem._decode_statg   s    4<<  AT\\""AABDLLA4;;4;;H%%33("3"3"7"7 4  X&&44("3"3"7"7 5 
 ((K$6$6s$;T]]#KLCK
r   c                ,   V P                  V4      p\        P                  R V4       V P                  P	                  V4       Uu. uF  q0P                  W14      NK  	  ppV'       d   V# V Uu. uF  q3R,          NK  	  pp\        V4      # u upi u upi )zListing folder %srI   )r)   r   r   r#   listdir_iterrJ   sorted)r   r'   detailrK   statspathss   &&&   r   lsSFTPFileSystem.ls   s    ##D)($/;?88;P;PQU;VW;V4""4.;VWL.34ed&\\eE4%=  X 5s   B.Bc                    V P                  V P                  \        P                  ! V4      4      R R7       \        P                  RW4       V P                  P                  W4       R# )Tr?   zPut file %s into %sN)mkdirs_parentosfspathr   r   r#   put)r   lpathrpathcallbackkwargss   &&&&,r   put_fileSFTPFileSystem.put_file   sC    DLL5!12TB*E9U"r   c                    V P                  V4      '       d   \        P                  ! VR R7       R# V P                  P	                  V P                  V4      V4       R# )Trr   N)isdirru   r5   r#   getr)   )r   ry   rx   r{   s   &&&,r   get_fileSFTPFileSystem.get_file   s<    ::eKK-HHLL--e4e<r   c                   \         P                  RV4       VP                  RR4      RJ d   RP                  V P                  \        \        P                  ! 4       4      .4      pV P                  P                  YRV'       d   TMRR7      pWVn        Wn
        Wn        \        P                  ! \        V4      Vn        \        P                  ! \         V4      Vn        V# V P                  P                  YV'       d   TMRR7      pV# )z
block_size: int or None
    If 0, no buffering, if 1, line buffering, if >1, buffer that many
    bytes, if None use default from paramiko.
zOpening file %s
autocommitTFr;   )bufsize)r   r   r   rc   r   struuiduuid4r#   open
targetpathfstypes
MethodTypecommit_a_filecommitdiscard_a_filediscard)r   r'   r8   
block_sizer{   path2fs   &&&&,  r   _openSFTPFileSystem._open   s     	&-::lD)U2HHdmmS->?@Ee:QSTAJLD''q9AH((;AI  d
*PRSAr   c                    V P                  V4      '       d   V P                  P                  V4       R # V P                  P                  V4       R # N)r   r#   rE   removerF   s   &&r   _rmSFTPFileSystem._rm   s1    ::dHHNN4 HHOOD!r   c                    V P                  V4      pV P                  V4      p\        P                  R W4       V P                  P	                  W4       R# )zRenaming %s into %sN)r)   r   r   r#   posix_rename)r   oldnews   &&&r   mvSFTPFileSystem.mv   sC    ""3'""3'*C5c'r   )r   r#   r   r   r   )sftpssh)T  )Fr   r   )F)rbN)__name__
__module____qualname____firstlineno____doc__r,   r   r   classmethodr)   staticmethodr/   r6   r5   rE   rL   rJ   ro   r|   r   r   r   r   __static_attributes____classdictcell____classcell__)r   __classdict__s   @@r   r	   r	      s      H,+ 3 3  	'3
  0!#
=("( (r   r	   c                 f    V P                   P                  V P                  V P                  4       R # r   )r   r   r   r   r$   s   &r   r   r      s    GGJJt}}doo.r   c                 P    V P                   P                  V P                  4       R # r   )r   r   r   r$   s   &r   r   r      s    GGKKr   )r]   loggingru   r   r   rK   r   r   r   r=   r   utilsr   	getLoggerr   r	   r   r   r   r   r   <module>r      sJ      	   !  ! )			=	)c(' c(L/r   