|
@@ -92,7 +92,7 @@ function delFile() {
|
|
|
|
|
|
/***********************************/
|
|
/***********************************/
|
|
function getLastFile(dirPath, number, callback) {
|
|
function getLastFile(dirPath, number, callback) {
|
|
- fs.readdir(dirPath, async (err, files) => {
|
|
|
|
|
|
+ fs.readdir(dirPath, (err, files) => {
|
|
// logger.info(`---------------------4`)
|
|
// logger.info(`---------------------4`)
|
|
if (err) {
|
|
if (err) {
|
|
logger.error(`无法列出目录。`, err);
|
|
logger.error(`无法列出目录。`, err);
|
|
@@ -104,7 +104,7 @@ function getLastFile(dirPath, number, callback) {
|
|
for (file of files) {
|
|
for (file of files) {
|
|
const filePath = path.join(dirPath, file);
|
|
const filePath = path.join(dirPath, file);
|
|
// logger.info("所有文件:",filePath)
|
|
// logger.info("所有文件:",filePath)
|
|
- const stats = await fs.promises.stat(filePath);
|
|
|
|
|
|
+ const stats = fs.promises.stat(filePath);
|
|
if (stats.isFile()) {
|
|
if (stats.isFile()) {
|
|
let tt = stats.birthtime.getTime()
|
|
let tt = stats.birthtime.getTime()
|
|
fileList.push({name: file, time: tt});
|
|
fileList.push({name: file, time: tt});
|