Your IP : 216.73.216.213


Current Path : /opt/alt/python34/lib64/python3.4/Tools/scripts/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib64/python3.4/Tools/scripts/__pycache__/md5sum.cpython-34.pyo

�
e f�	�@sdZdadadadtZddlZddlZddlZddlZddl	m
Z
dd�Zejd	d
�Z
ejdd�Zejd
d�ejdd�Zedks�eejdkr�ejeejd
d�ej��ndS)z9Python utility to print MD5 checksums of argument files.
i�N�rbaD
usage: md5sum.py [-b] [-t] [-l] [-s bufsize] [file ...]
-b        : read files in binary mode (default)
-t        : read files in text mode (you almost certainly don't want this!)
-l        : print last pathname component only
-s bufsize: read buffer size (default %d)
file ...  : files to sum; '-' or no files means stdin
�)�md5cGs�d}|r@t|dtj�r@|d|dd�}}n	tj}t|�dkr|t|dt�r||d}nxt|D]l}t|t�r�|dkr�ttjd|�p�|}q�t	||�p�|}q�t
||�p�|}q�W|S)Nr��-z<stdin>���rr)�
isinstance�io�IOBase�sys�stdout�len�str�
printsumfp�stdin�printsum�sum)�files�sts�out�f�r�9/opt/alt/python34/lib64/python3.4/Tools/scripts/md5sum.pyrs	&

rcCs�yt|t�}WnCtk
rX}z#tjjd||f�dSWYdd}~XnXtrnt|�}nt|||�}|j�|S)Nz%s: Can't open: %s
r)	�open�rmode�IOErrorr
�stderr�write�fnfilterr�close)�filenamer�fp�msgrrrrr,s
rcCs�t�}yUxN|jt�}|s(Pnt|t�rL|j|j�}n|j|�qWWnCtk
r�}z#t	j
jd||f�dSWYdd}~XnX|jd|j�|f�dS)Nz%s: I/O error: %s
rz%s %s
r)
r�read�bufsizerr
�encode�encoding�updaterr
rrZ	hexdigest)r rr�m�datar!rrrr8s	rrcCsytj|d�\}}WnPtjk
rn}z-tjjdtjd|tf�dSWYdd}~XnXxt|D]l\}}|dkr�tjj	a
qv|dkr�daqv|dkr�d	aqv|d
krvt|�a
qvqvW|s�dg}nt||�S)Nzblts:z	%s: %s
%sr�z-lz-brz-t�rz-sr)�getopt�errorr
rr�argv�usage�os�path�basenamerr�intr#r)�argsrZoptsr!�o�arrr�mainHs"$		r6�__main__)�__doc__r#rrr.rr
r/r+Zhashlibrrrrrr-r6�__name__�exitrrrr�<module>s	
"