--- client.c.orig Tue Aug 21 14:33:11 2001 +++ client.c Tue Aug 21 14:34:46 2001 @@ -1920,8 +1920,31 @@ (unsigned char *) buf, size)) error (1, 0, "aborting due to compression error"); } - else if (write (fd, buf, size) != size) - error (1, errno, "writing %s", short_pathname); + else + { + int size_count; + int work_size = size; + char * temp_buf = buf; + + /* Doing a while loop on the write command because it + * sometimes doesn't work writing a large file in one shot. + * */ + while (1) + { + size_count = write (fd, temp_buf, work_size); + if ( -1 == size_count ) + { + error (1, errno, "writing %s", short_pathname); + break; + } + if ( size_count >= work_size ) + { + break; + } + work_size -= size_count; + temp_buf += size_count; + } + } } if (close (fd) < 0)