yeah, well the way i look at it, 90% of the time im going to have to populate a file with data. how that data might come to me, in most cases i think, as part of-or fully contained in a variable, so a len() function should work most of the time...wouldnt you say. but yeah, some cool, ReadCharInFile() function would rock.
tw -----Original Message----- From: S. Isaac Dealey [mailto:info@;turnkey.to] Sent: Saturday, October 19, 2002 10:23 AM To: CF-Talk Subject: RE: counting # of characters in file 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

