File Transfer

I need to transfer a file wirelessly and automatically from 1 comp. to another comp. what should I do to achieve this? what function calls are needed? If the file is say 60kb, but the wireless modem can only handle 5kb a sec, what should i do?

File size and transfer rate are independent. If the file is 60kb and transfer rate is 5kb it just mean that it will take 12 seconds to tranfer.

How you transfer depends on the type of connection, tcp/ip? Qnet? Serial, zmodem, custom protocol. The fact that’s it’s wireless is totaly irrelavent.

I send the file out by serial connection.
currently i have the following code,

struct pic_data {
unsigned char parts[2048];
};

FILE *fp;
struct pic_data picturefile;
sprintf( filename, “pictureA.jpg”);
fp = fopen( filename , “r” );

while( !feof( fp ) )
{
fread( &picturefile, sizeof( struct pic_data ), 1, fp);
write( Channelidentifier, &picturefile, sizeof( struct pic_data ));
}

fclose(fp);

Does this mean that the program will read 2048 bytes at a time from the “pictureA.jpg” file and then send it serially at 2048 bytes a packet until the “pictureA.jpg” file is completely read?

The code seems to stop after its first iteration instead of continuing until the file is fully read, what could be the problem?