• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Date Accessed with cfdirectory

Guest
Mar 22, 2007 Mar 22, 2007

Copy link to clipboard

Copied

Is there a way to retrieve "Date Accessed" using cfdirectory in CF6.1?

Details:
I am upgrading \ cleaning a site for a client, from CF5 to CF6.1 (for now)
There are 4k+ cf files, many of which are named "copy of..." or "act_fileName1, 2, 3...cfm", and many more have been copied to another directory.
I need to determine which files are actually being used.
My plan is to 'touch' the files, setting date accessed to '1/1/2007 1:00PM' and have testers run through the site.
This would tell me which files are actually being used, but I would like to use cfdirectory to list these files for me.

I am open to alternative suggestions.
TOPICS
Advanced techniques

Views

761

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Mar 22, 2007 Mar 22, 2007
That would have taken too long. I came up with this:

C:\Inetpub\wwwroot>ls -Rutla > files.txt

With a little RegEx fiddling, I can get my list.

Votes

Translate

Translate
Guest
Mar 22, 2007 Mar 22, 2007

Copy link to clipboard

Copied

<CFDIRECTORY NAME="foo" ACTION="list" ... > returns several variables, two of which are the file name dateLastModified. The concept code below should give you the idea.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 22, 2007 Mar 22, 2007

Copy link to clipboard

Copied

Thanks, but I need #foo.dateLastAccessed# {not modified}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 22, 2007 Mar 22, 2007

Copy link to clipboard

Copied

You may be stuck.

In Windows Explorer, I right click a file and view properties. The last accessed date is the date and time of the right click. Similar to the Heisenberg Uncertainty Principal, the mere act of getting the "last accessed" date/time of a file requires that the file be accessed. Catch 22.

Your best bet is probably your Web logs, where you can get not only the last accessed, but the frequency of access, time of day, etc.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 22, 2007 Mar 22, 2007

Copy link to clipboard

Copied

I would also like it to be recursive ( I am using CF6.1)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 22, 2007 Mar 22, 2007

Copy link to clipboard

Copied

cfdirectory is not setting the date accessed, I checked the logs, it only records the page requested, index.cfm, not templates.

That gave me an idea to write a script to log accessed files in CF, but again, it wouldn't record templates. I am going to try writing a shell script to set modified dtm to accessed dtm. I will post if it works.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 22, 2007 Mar 22, 2007

Copy link to clipboard

Copied

LATEST
That would have taken too long. I came up with this:

C:\Inetpub\wwwroot>ls -Rutla > files.txt

With a little RegEx fiddling, I can get my list.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation