From f22ecabc8fd6bae89ea2c6d17594fb87b1c4ccf1 Mon Sep 17 00:00:00 2001 From: Nahuel Rullo Date: Thu, 19 May 2016 14:27:00 -0300 Subject: [PATCH 1/2] mtime instead of ctime --- find-remove.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/find-remove.js b/find-remove.js index dd2f510..701de23 100644 --- a/find-remove.js +++ b/find-remove.js @@ -8,9 +8,9 @@ var fs = require('fs'), function isOlder(path, ageSeconds) { var stats = fs.statSync(path), - ctime = stats.ctime.getTime() + mtime = stats.mtime.getTime() - return (ctime + (ageSeconds * 1000)) < now; + return (mtime + (ageSeconds * 1000)) < now; } function getMaxLevel(options) { From 8a325be8bde598e434cc13f477444ab4680fcf51 Mon Sep 17 00:00:00 2001 From: Nahuel Rullo Date: Thu, 19 May 2016 14:27:00 -0300 Subject: [PATCH 2/2] mtime instead of ctime. When you try to find a file by timestamp, you always use de mtime. ctime is used when the permissions file changes, but mtime, when the content file is changed. --- find-remove.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/find-remove.js b/find-remove.js index dd2f510..701de23 100644 --- a/find-remove.js +++ b/find-remove.js @@ -8,9 +8,9 @@ var fs = require('fs'), function isOlder(path, ageSeconds) { var stats = fs.statSync(path), - ctime = stats.ctime.getTime() + mtime = stats.mtime.getTime() - return (ctime + (ageSeconds * 1000)) < now; + return (mtime + (ageSeconds * 1000)) < now; } function getMaxLevel(options) {