|
@@ -102,27 +102,27 @@ function getLastFile(dirPath, number, callback) {
|
|
|
let fileList = [];
|
|
|
|
|
|
|
|
|
- for (var i = files.length - 1; i >= 0; i--) {
|
|
|
- var file = files[i];
|
|
|
- logger.info(`--------02..00`, dirPath, file,i,files.length)
|
|
|
- const filePath = path.join(dirPath, file);
|
|
|
- const stats = await fs.promises.stat(filePath);
|
|
|
- fileList.push({name: file, time: stats.mtimeMs});
|
|
|
-
|
|
|
- if (fileList.length > number) {
|
|
|
- break
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
-
|
|
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
+ for (file of files) {
|
|
|
+ logger.info(`--------02..00`, dirPath, file,files.length,fileList.length)
|
|
|
+ const filePath = path.join(dirPath, file);
|
|
|
+ logger.info(`--------02..111`, filePath)
|
|
|
+ const stats = await fs.promises.stat(filePath);
|
|
|
+ logger.info(`--------02..22222`, stats)
|
|
|
+ fileList.push({name: file, time: stats.mtimeMs});
|
|
|
+ }
|
|
|
+
|
|
|
logger.info(`--------03`)
|
|
|
fileList.sort((a, b) => b.time - a.time);
|
|
|
logger.info(`--------04`)
|