Hi all,
I am currently creating a database which stores reports away in a directory structure. This structure is made up of various subdirectories
e.g. Database Dir\Report No\Status\Sent
In the above example the reports when first exported are stored as Excel files in Database Dir\Report No\Status\. When they are automatically sent to the customers they are moved to the Sent subdirectory.
I am creating a process that has to remove all files older than 6 months. The way I find out the date of the file is that it makes up part of the filename. Does anyone know how to go through each of the subdirectories under the Database Dir and bring back each filename under them in turn? I would like to do this without having to calculate each subdirectory name if possible. In other words it should scan through them all going up and down in levels where required
Example of process:
Under the Database Dir there is two stored reports. The first is in Database Dir\UserReport\Open\Sent\. The second is in Database Dir\GroupReport\Closed\. So first it checks in Database Dir and finds UserReport subdir and GroupReport subdir. So it goes into UserReport subdir and in here it finds Open. So it goes into Open subdir and in here it finds Sent. So it goes into Sent subdir and in here it finds the file. It reads the filename and gets the date. There are no more files so it goes back to Open subdir. There are no more files or subdirs here so it goes back to UserReport. There are no more files or subdirs here so it goes back to Database Dir...etc
Also does anyone know how to read a file and bring back the created date from it?
I am currently creating a database which stores reports away in a directory structure. This structure is made up of various subdirectories
e.g. Database Dir\Report No\Status\Sent
In the above example the reports when first exported are stored as Excel files in Database Dir\Report No\Status\. When they are automatically sent to the customers they are moved to the Sent subdirectory.
I am creating a process that has to remove all files older than 6 months. The way I find out the date of the file is that it makes up part of the filename. Does anyone know how to go through each of the subdirectories under the Database Dir and bring back each filename under them in turn? I would like to do this without having to calculate each subdirectory name if possible. In other words it should scan through them all going up and down in levels where required
Example of process:
Under the Database Dir there is two stored reports. The first is in Database Dir\UserReport\Open\Sent\. The second is in Database Dir\GroupReport\Closed\. So first it checks in Database Dir and finds UserReport subdir and GroupReport subdir. So it goes into UserReport subdir and in here it finds Open. So it goes into Open subdir and in here it finds Sent. So it goes into Sent subdir and in here it finds the file. It reads the filename and gets the date. There are no more files so it goes back to Open subdir. There are no more files or subdirs here so it goes back to UserReport. There are no more files or subdirs here so it goes back to Database Dir...etc
Also does anyone know how to read a file and bring back the created date from it?