You can use some Java to get what you want.

<cfset filename = "/path/to/file" />
<cfset fis = createObject("java", "java.io.FileInputStream").init(filename)
/>
<cfset bis = createObject("java", "java.io.BufferedInputStream").init(fis)
/>

And if your file is text-only (not binary), you can convert it to a reader,
rather than an input stream:

<cfset filename = "/path/to/file" />
<cfset fis = createObject("java", "java.io.FileInputStream").init(filename)
/>
<cfset isr = createObject("java", "java.io.InputStreamReader").init(fis) />
<cfset br = createObject("java", "java.io.BufferedReader").init(isr) />

You can then read in the file's contents out of the input stream or reader,
and the underlying java will take care of buffering it off the disk for you.

Cheers,
barneyb

> -----Original Message-----
> From: Dustin Snell [Network Automation, Inc]
> [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 12, 2004 3:47 PM
> To: CF-Talk
> Subject: CFFILE doesn't seek - how to do large files then?
>
> I see that Macromedia recommends not using CFFILE with large
> files such as
> log files because it reads the whole thing into memory. So,
> my question is -
> what are you supposed to do if you have to work with large files. I am
> surprised that there is no SEEK capability. Anyone agree that
> this should be
> in there? Or am I missing something?
>
> -Dustin Snell
> Network Automation, Inc
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to