Actually, it wouldn't have to iterate

<cfdirectory action="list" name="qGetDir" directory="C:\mydir\mysubdir"
filter="myfile.ext">

Should just return the single file.

- Calvin

-----Original Message-----
From: Katz, Dov B (IT) [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 10, 2005 2:32 PM
To: CF-Talk
Subject: RE: How to get file information?

 
CFDirectory is probably not that performant, as it has to iterate
through the file list to find the file you want.

I suggest 

<CFOBJECT type="java" name="MyFile"  class="java.io.File">
<Cfset myFile.init("#expandpath(yourfile...etc)#")>

Then you have access to all java.io.File's rich method library, such as
length(), canRead(), exists(), delete(), isDirectory() etc....

Not sure about performance tradeoff, but definitely more features doing
it this way...

-Dov

-----Original Message-----
From: Al Everett [mailto:[EMAIL PROTECTED] 
Sent: Monday, January 10, 2005 2:18 PM
To: CF-Talk
Subject: Re: How to get file information?

Use CFDIRECTORY with the "Filter" attribute. Then you'll only get
information about your specific file.


On Mon, 10 Jan 2005 14:16:56 -0500, Kazmierczak, Kevin
<[EMAIL PROTECTED]> wrote:
> How would one get information on a file from CF?  I want to know when 
> the file was last modified.  I know I could use cfdirectory and loop 
> over the directory contents and get it that way but that seems like 
> WAY too much work just to get the date on one file.
> 
> How come you can't use cffile variables on anything but an upload?
> Wouldn't it be helpful on all cffile actions?  They should have a 
> cffile action="readattribs" or something.
> 
> Is this too much to ask for? Or am I missing something. This is on
cf5.
> I could probably use a java to pull the information on MX, but that 
> isn't an option.
> 
> Thanks.
> 
> Kevin.
> 
> 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:189835
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to