OwlCyberSecurity - MANAGER
Edit File: file_util.pyo
� {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"���not copying %s (output up-to-date)i����s&���invalid value '%s' for 'link' arguments���%s %s -> %sR���R���(���t���distutils.dep_utilR���t���statR���R���R���R���R ���R���t���isfileR����t���isdirt���joint���basenamet���dirnameR���t���debugt���_copy_actiont���KeyErrort ���ValueErrort���infoR���t���samefilet���linkt���OSErrort���symlinkR���t���utimet���chmod(���R���R���t ���preserve_modet���preserve_timest���updateR,���t���verboset���dry_runR���R���R���R���R���t���dirt���actiont���st(����(����s+���/usr/lib64/python2.7/distutils/file_util.pyt ���copy_fileG���sT����""$ $ ' ' ! c��� ������C���s���d�d�l��m�}�m�}�m�}�m�}�m�}�d�d�l�} �|�d�k�rV�t�j�d�|��|���n��|�r`�|�S|�|����s�t �d�|������n��|�|���r��t �j�j�|�|�|������}�n%�|�|���r��t �d�|��|�f�����n��|�|�|�����s��t �d�|��|�f�����n��d �} �y�t �j �|��|���WnM�t �j�k �rb\�}�}�|�| �j�k�rFd�} �qct �d �|��|�|�f�����n�X| �r�t�|��|�d�|��y�t �j�|����Wq�t �j�k �r�\�}�}�y�t �j�|���Wn�t �j�k �r�n�Xt �d�d �|��|�|��|�f�����q�Xn��|�S(���s)��Move a file 'src' to 'dst'. If 'dst' is a directory, the file will be moved into it with the same name; otherwise, 'src' is just renamed to 'dst'. Return the new full name of the file. Handles cross-device moves on Unix using 'copy_file()'. What about other systems??? i����(���R���R!���R"���R$���R%���Ni���s���moving %s -> %ss#���can't move '%s': not a regular files0���can't move '%s': destination '%s' already existss2���can't move '%s': destination '%s' not a valid pathi����s���couldn't move '%s' to '%s': %sR4���s+���couldn't move '%s' to '%s' by copy/delete: s���delete '%s' failed: %s(���t���os.pathR���R!���R"���R$���R%���R���R���R*���R����R ���R���R#���t���renameR ���t���EXDEVR9���R ���( ���R���R���R4���R5���R���R!���R"���R$���R%���R���t���copy_itt���numt���msg(����(����s+���/usr/lib64/python2.7/distutils/file_util.pyt ���move_file����sP���� ( c���������C���sG���t��|��d���}�z&�x�|�D]�}�|�j�|�d���q�WWd�|�j����Xd�S(���s{���Create a file with the specified name and write 'contents' (a sequence of strings without line terminators) to it. t���ws��� N(���R���R���R���(���t���filenamet���contentst���ft���line(����(����s+���/usr/lib64/python2.7/distutils/file_util.pyt ���write_file����s ���� i�@��( ���t���__doc__t���__revision__R ���t���distutils.errorsR����t ���distutilsR���R���R'���R���R9���R@���RF���(����(����(����s+���/usr/lib64/python2.7/distutils/file_util.pyt���<module>���s��� 5 b<