rotating-file-stream
Advanced tools
Comparing version 1.1.7 to 1.1.8
@@ -5,3 +5,3 @@ "use strict"; | ||
var fs = require("fs"); | ||
var tmp = require("tmp"); | ||
var path = require("path"); | ||
var utils = require("./utils"); | ||
@@ -134,22 +134,48 @@ var zlib = require("zlib"); | ||
function external(src, dst, callback) { | ||
var att = {}; | ||
var cont; | ||
var self = this; | ||
tmp.file({ keep: true, mode: parseInt("777", 8) }, function(err, path, fd, done) { | ||
try { cont = self.options.compress(src, dst); } | ||
catch(e) { return process.nextTick(callback.bind(null, e)); } | ||
att[dst] = 1; | ||
self.findName(att, true, function(err, name) { | ||
if(err) | ||
return callback(err); | ||
var cb = function(err) { | ||
done(); | ||
callback(err); | ||
}; | ||
fs.write(fd, self.options.compress(src, dst), function(err) { | ||
fs.open(name, "w", parseInt("777", 8), function(err, fd) { | ||
if(err) | ||
return cb(err); | ||
return callback(err); | ||
fs.close(fd, function(err) { | ||
if(err) | ||
return cb(err); | ||
var close = fs.close.bind(fs, fd); | ||
var unlink = fs.unlink.bind(fs, name, function(err) { if(err) self.emit("warning", err); }); | ||
cp.exec(path, cb); | ||
fs.write(fd, cont, function(err) { | ||
if(err) { | ||
close(function(err) { | ||
if(err) | ||
self.emit("warning", err); | ||
unlink(); | ||
}); | ||
return callback(err); | ||
} | ||
close(function(err) { | ||
if(err) { | ||
unlink(); | ||
return callback(err); | ||
} | ||
if(name.indexOf(path.sep) === -1) | ||
name = "." + path.sep + name; | ||
cp.exec(name, function(err) { | ||
unlink(); | ||
callback(err); | ||
}); | ||
}); | ||
}); | ||
@@ -195,8 +221,11 @@ }); | ||
if(name in attempts) { | ||
attempts[name]++; | ||
return self.findName(attempts, tmp, callback); | ||
} | ||
fs.stat(name, function(err) { | ||
if((! err) || err.code !== "ENOENT") { | ||
if(name in attempts) | ||
attempts[name]++; | ||
else | ||
attempts[name] = 1; | ||
attempts[name] = 1; | ||
@@ -203,0 +232,0 @@ return self.findName(attempts, tmp, callback); |
{ | ||
"name": "rotating-file-stream", | ||
"version": "1.1.7", | ||
"version": "1.1.8", | ||
"description": "Opens a stream.Writable to a file rotated by interval and/or size. A logrotate alternative.", | ||
@@ -28,5 +28,2 @@ "scripts": { | ||
"readmeFilename": "README.md", | ||
"dependencies": { | ||
"tmp": "0.0.31" | ||
}, | ||
"devDependencies": { | ||
@@ -33,0 +30,0 @@ "eslint": "3.15.0", |
@@ -307,2 +307,4 @@ # rotating-file-stream | ||
* 2017-02-13 - v1.1.8 | ||
* removed tmp dependecy due it was causing a strange instability now disappeared | ||
* 2017-02-07 - v1.1.7 | ||
@@ -309,0 +311,0 @@ * fixed tmp.file call |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
0
358
4
2
31317
7
634
- Removedtmp@0.0.31
- Removedos-tmpdir@1.0.2(transitive)
- Removedtmp@0.0.31(transitive)