Coder Social home page Coder Social logo

pyrocopy's Issues

Unhandled IOError exceptions

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'

errno import missing

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.

[Proposal] Make buffer size configurable

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.

excludeDirs is overwriting excludeFiles in sync function

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.