Hacked By AnonymousFox
�
{fc @ s� d Z d Z d d l Z d d l m Z d d l m Z i d d 6d d 6d d
6Z d d
� Z d d d d d d d � Z
d d d � Z d � Z d S( sF distutils.file_util
Utility functions for operating on single files.
s $Id$i����N( t DistutilsFileError( t logt copyings hard linkingt hards symbolically linkingt symi i c C s� d } d } z�y t | d � } Wn2 t j k
rV \ } } t d | | f � � n Xt j j | � r� y t j | � Wq� t j k
r� \ } } t d | | f � � q� Xn y t | d � } Wn2 t j k
r� \ } } t d | | f � � n Xx� y | j | � } Wn2 t j k
rD\ } } t d | | f � � n X| sOPn y | j | � Wq� t j k
r�\ } } t d | | f � � q� Xq� WWd | r�| j
� n | r�| j
� n Xd S( s5 Copy the file 'src' to 'dst'.
Both must be filenames. Any error opening either file, reading from
'src', or writing to 'dst', raises DistutilsFileError. Data is
read/written in chunks of 'buffer_size' bytes (default 16k). No attempt
is made to handle anything apart from regular files.
t rbs could not open '%s': %ss could not delete '%s': %st wbs could not create '%s': %ss could not read from '%s': %ss could not write to '%s': %sN( t Nonet opent ost errorR t patht existst unlinkt readt writet close( t srct dstt buffer_sizet fsrct fdstt errnot errstrt buf( ( s+ /usr/lib64/python2.7/distutils/file_util.pyt _copy_file_contents sF
i i c C s� d d l m } d d l m } m }
m } m } t j j | � sW t
d | � � n t j j | � r� | }
t j j | t j j
| � � } n t j j | � }
| r� | | | � r� | d k r� t j d | � n | d f Sy t | } Wn! t k
rt d | � � n X| d k rxt j j
| � t j j
| � k r_t j d | | |
� qxt j d | | | � n | r�| d f S| d
k r�t j j | � o�t j j | | � sCy t j | | � | d f SWq�t k
r�q�XqCnP | d k rCt j j | � o#t j j | | � sCt j | | � | d f Sn t | | � | s\| r�t j | � } | r�t j | | | | |
f � n | r�t j | | | | � � q�n | d f S( s Copy a file 'src' to 'dst'.
If 'dst' is a directory, then 'src' is copied there with the same name;
otherwise, it must be a filename. (If the file exists, it will be
ruthlessly clobbered.) If 'preserve_mode' is true (the default),
the file's mode (type and permission bits, or whatever is analogous on
the current platform) is copied. If 'preserve_times' is true (the
default), the last-modified and last-access times are copied as well.
If 'update' is true, 'src' will only be copied if 'dst' does not exist,
or if 'dst' does exist but is older than 'src'.
'link' allows you to make hard links (os.link) or symbolic links
(os.symlink) instead of copying: set it to "hard" or "sym"; if it is
None (the default), files are copied. Don't set 'link' on systems that
don't support it: 'copy_file()' doesn't check if hard or symbolic
linking is available. If hardlink fails, falls back to
_copy_file_contents().
Under Mac OS, uses the native file copy function in macostools; on
other systems, uses '_copy_file_contents()' to copy file contents.
Return a tuple (dest_name, copied): 'dest_name' is the actual name of
the output file, and 'copied' is true if the file was copied (or would
have been copied, if 'dry_run' true).
i����( t newer( t ST_ATIMEt ST_MTIMEt ST_MODEt S_IMODEs4 can't copy '%s': doesn't exist or not a regular filei s"