View Single Post
Old 04-23-2004, 09:11 AM   #1 (permalink)
hrdwareguy
"Officer, I was in fear for my life"
 
hrdwareguy's Avatar
 
Location: Oklahoma City
[Delphi] Help with binary files

First of all, don't laugh because I'm using Delphi...it's not my choice.

I have to rewrite a c program in delphi and I'm having trouble dealing with binary files.

Here is my c code:
Code:
FILE:*fp,*fp1;
int:i,j;
fp=fopen(binfile,"rb");
while (!feof(f2))
{
    fp1=fopen(temp,"wb");
    for(i=0;i<100000;i++)
    {
        ch=fgetc(fp);
        if(feof(fp))
        {
            break;
        }
        fputc(ch,fp1);
    }
    fclose(fp1);
    do something with temp
}
This is used to break up large files and upload to our websit.

I need to do the same thing but only in Delphi.
__________________
Gun Control is hitting what you aim at

Aim for the TFP, Donate Today
hrdwareguy is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73