Notice: With the launch of Adobe Cookbooks, this site will no longer be accepting new entries or posting new content. Thanks to everyone who submitted content!

How do I get information about a file?

Use the getFileInfo() function.

GetFileInfo returns a structure with the following information: filename, path, parent directory, type, size, when the file was most recently modified, whether the file has read permission, write permission, and is hidden.

<cfdump var="#getFileInfo("/myFile.doc")#">


This question was written by Jeremy Petersen.
It was last updated on July 18, 2008 at 8:40:09 AM EDT.

CFML Referenced

GetFileInfo()

Categories

File and Directory Access

Comments

Comment made by Larry C. Lyons on July 18, 2008 at 9:00 AM
remember this tag is for CF8 only. For other flavours of CFMX, you can use the methods in the java.io.File class to get the same information.


Comment made by Raymond Camden on July 18, 2008 at 10:02 AM
Please remember this site always uses the most recent version of CF. It is mentioned in the FAQ I believe. By assuming 'most recent', we can make our entries more streamlined and simpler.