Hi,

> On Sat, Jan 9, 2016 at 11:44 AM, Tom Ehlert <[email protected]> wrote:
>> Hi,
>>
>> whoever is responsible currently for XCOPY (Blair?):
>>
>>
>> in line ~450, don't use
>>
>>
>>    if (chsize(fddest,filelength(fdsrc)) == -1)
>>       ...
>>
> ...

> Which version of XCOPY? and which file?  I don't see this line so I'm
> trying to figure out what I am overlooking.

good question. 'my' version is somehow based on rene's xcopy 1.0 from 2001; 
origin
unknown

the versions on ibiblio dropped (or never had) this functionality


   // try to make allocate space for destination
   // don't even start when the file won't fit

this code

        filesize = filelength(fdsrc);
        
        lseek(fddest, filesize, SEEK_SET);
        dosreadwrite(fddest, NULL,0, 1);                        // writing 0 
bytes extends or truncates file
        
        
  if (lseek(fddest, 0, SEEK_CUR) != filesize)
  {
        printf("There is not enough space on the disk (file %s, size 
%lu)\n",dest_filename,filelength(fdsrc));

    close(fdsrc);
    close(fddest);
    unlink(dest_filename);
    if (return_on_error) {
      return;
    }
    else {
      exit(29);
        }
  }


  lseek(fddest, 0, SEEK_SET);  



allocates the space required for the file before copying starts.

btw: having executable code in 'shared.inc' is extremely bad coding
praxis; only allowed for pascal which had no concept of modules

Tom


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to