caskater4 / pyrocopy Goto Github PK
View Code? Open in Web Editor NEWRobust file utilities for Python inspired by Windows' robocopy.
License: MIT License
Robust file utilities for Python inspired by Windows' robocopy.
License: MIT License
pyrocopy doesn't handle IOErrors when copying. For example:
pyrocopy %USERPROFILE% %TEMP%\test\pyro -q
Traceback (most recent call last):
File "C:\Users\USERNAME\AppData\Roaming\Python\Scripts\pyrocopy.exe", line 9, in <module>
sys.exit(main())
File "C:\Users\USERNAME\AppData\Roaming\Python\Python27\site-packages\pyrocopy\__init__.py", line 57, in main
results = pyrocopy.copy(args.source, args.destination, includeFiles=args.includefiles, includeDirs=args.includedirs, excludeFiles=args.excludefiles, excludeDirs=args.excludedirs, level=args.level, followLinks=args.followlinks, forceOverwrite=args.force, preserveStats=(not args.nostat))
File "C:\Users\USERNAME\AppData\Roaming\Python\Python27\site-packages\pyrocopy\pyrocopy.py", line 263, in copy
preserveStats=preserveStats)
File "C:\Users\USERNAME\AppData\Roaming\Python\Python27\site-packages\pyrocopy\pyrocopy.py", line 999, in _copyFile
with open(src, 'rb') as fsrc:
IOError: [Errno 13] Permission denied: 'C:\\Users\\USERNAME\\NTUSER.DAT'
I haven't been able to test this as I don't have a UNIX/*BSD system, but I think the try...except...
part of _copyStats()
that copies the flags uses the errno module, but it doesn't appear to be imported anywhere.
Especially for transferring to a network share, it may be advantageous to have a larger buffer size. I got a 33% speed increase transferring a 740 G file over gigabit to a samba share (Win XP VM to CentOS host) by bumping up the buffer size to as much a 4MiB. I propose making a module-level variable in pyrocopy.py
that is used in _copyFile()
to set the buffer size in kiB.
should be like this
results = copy(path1, path2, includeFiles=includeFiles, includeDirs=includeDirs, excludeFiles=excludeFiles,
excludeDirs=excludeDirs, level=level, followLinks=followLinks, forceOverwrite=forceOverwrite,
preserveStats=preserveStats, detailedResults=True)
results2 = copy(path2, path1, includeFiles=includeFiles, includeDirs=includeDirs, excludeFiles=excludeFiles,
excludeDirs=excludeDirs, level=level, followLinks=followLinks, forceOverwrite=forceOverwrite,
preserveStats=preserveStats, detailedResults=True)
This should be pretty easy--mostly just augmenting 2to3 output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.