Skip to content

How to get file age in javascript reader #5822

Closed Answered by pacmano1
rutledj asked this question in Q&A
Discussion options

You must be logged in to vote

I will end with this: I asked chatGPT to comment the function.

/**
 * This function returns a list of files from a given directory, filtered by modification time and file extension.
 *
 * @param {string} directoryPath - The path of the directory to scan for files.
 * @param {number} hours - Only files modified within these many hours will be included.
 * @param {string} fileExtension - The extension of the files to include. This check is case-insensitive.
 * @return {string[]} An array of file paths for files that match the criteria.
 */
function getFilesModifiedWithinHours(directoryPath, hours, fileExtension) {
    // Define a custom FileFilter
    var fileFilter = new java.io.FileFilter({

Replies: 9 comments 7 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@JacksonUptain
Comment options

Comment options

You must be logged in to vote
1 reply
@jonbartels
Comment options

Comment options

You must be logged in to vote
1 reply
@jonbartels
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@rutledj
Comment options

@pacmano1
Comment options

Comment options

You must be logged in to vote
2 replies
@pacmano1
Comment options

@pacmano1
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by pacmano1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants