Low level I/O file 
Author Message
 Low level I/O file

Hello Clipper programmers,
I have a problem about managing files using the low level file I/O
functions (fcreate(), fopen()  and so)
Does anyone knows if are there any limitations about the maximum size of
the file to be opened?
I know that many 16 bit compilers have the 64K limits.
Another problem : I have to show the contents of this file within a Clipper
program.
The memoedit() function has the 64K limits; how can I do to bypass this
limit?

Tank you to everyone will help me.

Bye
Silvano



Sat, 25 Nov 2000 03:00:00 GMT  
 Low level I/O file

There are no 64K limits on the size of the file you can open. Only in the size
of the string you can read in from that file!

If all you have to do is display the information, there are several tricks that
will work. One is to create an unindexed table with one character field 80
characters wide. Then freadstr() a hunk of the file, chop it into 80 character
pieces, and append records to the table. When you dbedit() or Tbrowse() the
file, it will be like scrolling through text, as far as the end-result is
concerned.

Mostly I've used file I/O for data conversions and the like; I've not tried to
use Clipper as a tool to edit or view large text files. (MS DOS's EDIT.COM or
Win95's EDIT.EXE work so much nicer for things like that...)

Besides showing the contents of the file, what other things do you need done
with the information? I've got some routines that grab a 60-meg text file and
dig out about 16meg worth of data and add it to a table; I can certainly share
the code with you if it would come close to what you need.

Al

Quote:

> Hello Clipper programmers,
> I have a problem about managing files using the low level file I/O
> functions (fcreate(), fopen()  and so)
> Does anyone knows if are there any limitations about the maximum size of
> the file to be opened?
> I know that many 16 bit compilers have the 64K limits.
> Another problem : I have to show the contents of this file within a Clipper
> program.
> The memoedit() function has the 64K limits; how can I do to bypass this
> limit?

> Tank you to everyone will help me.

> Bye
> Silvano



Sat, 25 Nov 2000 03:00:00 GMT  
 Low level I/O file

: Hello Clipper programmers,
: I have a problem about managing files using the low level file I/O
: functions (fcreate(), fopen()  and so)
: Does anyone knows if are there any limitations about the maximum size of
: the file to be opened?

Silvano:
        AFAIK, low level functions don't have that limit.  Just read the
files in chunks and string them together.

        For a large ASCII file reader, get FBROWSE.ZIP from the OASIS.
It's free and comes with code, so you can modify it as you need.

HTH,
Ted Cleaver

: I know that many 16 bit compilers have the 64K limits.
: Another problem : I have to show the contents of this file within a Clipper
: program.
: The memoedit() function has the 64K limits; how can I do to bypass this
: limit?

: Tank you to everyone will help me.

: Bye
: Silvano

--



Sat, 25 Nov 2000 03:00:00 GMT  
 Low level I/O file


Quote:
> I have a problem about managing files using the low level file I/O
> functions (fcreate(), fopen() and so) Does anyone knows if are there any
> limitations about the maximum size of the file to be opened?

The only limitations are those imposed by the operating system.

Quote:
> I know that many 16 bit compilers have the 64K limits.

There is no 64K limit on file operations. Think about it, if there was,
you'd never be able to have a database bigger than 64K. The limitation you
*do* have is that you can't read more than 64K from a file in one go, but,
this really isn't an issue (at least, it's never been an issue for me).

Suppose, for example, you wanted to copy the contents of a multi-megabyte
file. You'd do something like:

  #define BUFF_SIZE ( 32 * 1024 ) // 32k buffer

  Local cBuffer := space( BUFF_SIZE )

  ...open source, create target


     fwrite( hTarget, cBuffer, len( cBuffer ) )
  EndDo

  ...close files...

(note that *lots* of error checking was omitted for the sake of brevity).

Quote:
> Another problem : I have to show the contents of this file within a
> Clipper program.  The memoedit() function has the 64K limits; how can I do
> to bypass this limit?

Don't use memoedit(). Look on The Oasis (http://www.iag.net/~philb/) for
FBROWSE.ZIP (I think that is the name), this can handle huge files because
it displays then direct from disk instead of loading them into memory and
then displaying them.

Be warned that I did find some problems with the FBROWSE code, it would get
upset if you tried to use a "window" smaller than the screen, I did have a
look at fixing this but found the code, err, hard to work with <g>. So, to
preserve my nice interface I tend to display files inside a memoedit()
unless they are too big for memoedit(), in which case I display something
like "Text is too large, use zoom to view" in the memoedit() and have a zoom
button on screen that pulls up a full screen FBROWSE (I also allow zoom for
small files too so that this appears to be a "feature", design by accident,
you've gotta love it <g>).

--
Take a look in Hagbard's World: |     w3ng - The WWW Norton Guide reader.
http://www.acemake.com/hagbard/ |  ng2html - The NG to HTML converter.
http://www.hagbard.demon.co.uk/ |       eg - Norton Guide reader for Linux.
Free software, including........|   dgscan - DGROUP scanner for Clipper.



Sat, 25 Nov 2000 03:00:00 GMT  
 Low level I/O file

Quote:

>   #define BUFF_SIZE ( 32 * 1024 ) // 32k buffer

>   Local cBuffer := space( BUFF_SIZE )

>   ...open source, create target


>      fwrite( hTarget, cBuffer, len( cBuffer ) )
>   EndDo

Oops. That should have read:


--
Take a look in Hagbard's World: |     w3ng - The WWW Norton Guide reader.
http://www.acemake.com/hagbard/ |  ng2html - The NG to HTML converter.
http://www.hagbard.demon.co.uk/ |       eg - Norton Guide reader for Linux.
Free software, including........|   dgscan - DGROUP scanner for Clipper.



Sat, 25 Nov 2000 03:00:00 GMT  
 Low level I/O file

On 9 Jun 1998 06:37:26 GMT, "Silvano Lagorio"

Quote:

>Hello Clipper programmers,
>I have a problem about managing files using the low level file I/O
>functions (fcreate(), fopen()  and so)
>Does anyone knows if are there any limitations about the maximum size of
>the file to be opened?

Clipper's low-level routines are limited by the capacity of the
FSEEK() function's offset argument, which if memory serves me
correctly has a maximum value of 2 ^ 31, or 2,147,483,648 bytes.

As this is also the size limit of xBase-format *.dbf files this is
most likely a limit tied to DOS itself.

--
Clark Morrison



Sat, 25 Nov 2000 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Really Low Low Low Level Stuff.

2. os low-level question

3. books dealing with low level I/Os?

4. High Level ASM and Low Level ASM

5. Low-Level File I/O

6. Low-level file read

7. Low Level File I/O

8. Low level file io ?

9. Low level file I/O question

10. Low level disk/file info from 32bit VC?

11. system level or chip level text file

12. Low-level socket programming

 

 
Powered by phpBB® Forum Software