Comments (3)
Hey. Yeah, I think exec
buffers stdout and stderr before returning it to Node all in one go, whereas spawn
will launch a new process and stream the output back to Node. The max buffer for exec
is only 200*1024 bytes. In your rsyncwrapper options are you specifying any options that could cause it to return a lot of information back to Node in stdout (--progress
or --stats
for example)? That could be pushing you over the buffer limit ... ?
In any case it sounds like it might be a good idea to swap this over to spawn
anyway. Feel free to fork and pull request, or else I'll add this to my to-do list! ^^
from rsyncwrapper.
Perhaps it was using the --dryRun
option. Either way I was able to fix it by using spawn
. The major difference is the complete callback, where spawn
does not return a single callback, but instead allows you to listen on the data stream. By listening on exit
you can safely determine the process completed with or without errors but it may be an architecture change for this package. Do you have any thoughts?
This is what I have which obviously ignores errors:
var process = spawn('rsync', args);
process.stdout.on('data', function (data) {
console.log('stdout: ' + data);
});
process.stderr.on('data', function (data) {
console.log('stderr: ' + data);
});
process.on('exit', function (code) {
console.log('child process exited with code ' + code);
callback(null,null,null,null);
});
from rsyncwrapper.
Great, thanks for the code! Fixed in 543b3a5.
from rsyncwrapper.
Related Issues (20)
- Missing doc on noExec option HOT 6
- Using rsync on Windows returns syntax error HOT 4
- Rename option `syncDest` to `delete` or similar HOT 3
- rsync failed on windows, copying persmissions HOT 4
- windows rsync exited with code 11 HOT 1
- cannot provide multiple -f args HOT 4
- Excluded file and directories are being delete. How to exclude but not delete? HOT 1
- Order of include exclude HOT 4
- Tests fail on iojs HOT 1
- Feature Request: Progress HOT 4
- Unless you enable `verbose`, stdout and stderr in the callback are empty HOT 1
- Args Issue HOT 4
- Gulp task HOT 3
- Doesn't escape src option HOT 5
- Publish a new version to use lodash 4.15.0 HOT 1
- Seems to interfere with console colors on Windows HOT 1
- Update to latest lodash or remove the dependency
- import issue HOT 8
- Issue with escaping space - space in src or dest
- Add support for environment variables HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rsyncwrapper.