WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: LAKosin on November 10, 2016, 06:29:04 AM

Title: Most Current File In Directory Tree
Post by: LAKosin on November 10, 2016, 06:29:04 AM
I seem to be having a major brain freeze.
I need to be able to search a directory structure (Unknown levels of sub directories) to find the file that was most currently written and the file that was most currently accessed.

I'm totally drawing a blank as to how to get started.

Any hints would be appreciated.

Thanks in advance.
Title: Re: Most Current File In Directory Tree
Post by: td on November 10, 2016, 07:46:20 AM
Use the File and Folder (FaF) extender's functions to traverse the directory structure and obtain file path+names or directory paths.  Then either use the FileTimeGetEx or FileInfoToArray function to get the time info.  An approach using the former function is a little more straight forward but using the latter could possibly yield a script that executed a little more quickly.   The FaF extender is part of the Search extender package that can be found on the WinBatch Download webpage.
Title: Re: Most Current File In Directory Tree
Post by: LAKosin on November 10, 2016, 08:36:12 AM
Thanks for the information.
I was NOT aware of the FaF extender.
I'll check it out.