Welcome ... I wonder if there may be a better way to do it than with
<cffile> possibly using a java class... It just seems like the function I
wrote below would be awfully heavy if you wanted to output the lengths of
files in say a <cfdirectory> query with more than a small handful of files.

> that what i ended up doing last night....in the code
> just above it, the contents happened to be in a variable
> so i just did a len() of that ;) and it worked!!!

> thanks anyway isaac.
> t
> w

> -----Original Message-----
> From: S. Isaac Dealey [mailto:info@;turnkey.to]
> Sent: Friday, October 18, 2002 11:49 PM
> To: CF-Talk
> Subject: Re: counting # of characters in file


>> is there a function, that i missing from the help file
>> for some reason, cant find anything, to count the amount
>> of characters in a file?

>> not the file length, but the actual amount of characters
>> in a file?

> There's no native function, you'd have to read in the file
> and check the
> length...
> In CFMX you could write this into a UDF.

> <cffunction name="getFileLength">
>       <cfargument name="filepath" type="string">

>       <cffile action="read" file="#filepath#"
>       variable="myfile">
>       <cfreturn value="#len(myfile)#">
> </cffunction>


> hth

> Isaac
> Certified Advanced ColdFusion 5 Developer

> www.turnkey.to
> 954-776-0046


> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ~~~~~~~~~~~|
> Archives:
> http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
> Subscription: http://www.houseoffusion.com/index.cfm?sideb
> ar=lists&body=lists/cf_talk
> FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
> Your ad could be here. Monies from ads go to support these
> lists and provide more resources for the community.
> http://www.fusionauthority.com/ads.cfm


Isaac
Certified Advanced ColdFusion 5 Developer

www.turnkey.to
954-776-0046

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to