How do I go through a folder and find out which is the newest created/modified file and put the full path of it into a var as string?
Haven’t really figured out io/best practices for io
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Take a look at http://nodejs.org/api/fs.html#fs_class_fs_stats
look at the
ctimeormtimeto find the created and modified time.Something like this:
loops the current directory (.) and logs the file name, grabs the file stats and logs the modified time (mtime) and create time (ctime)