Just a sample of the Echomail archive
Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.
|    PASCAL    |    Pascal programming language discussions    |    592 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 558 of 592    |
|    Chad Adams to Nick Andre    |
|    Re: Copy File    |
|    04 Sep 22 22:52:07    |
   
   TID: Mystic BBS 1.12 A48   
   MSGID: 1:19/37 16876f73   
   REPLY: 1:229/426 FD835021   
   TZUTC: -0500   
   Thanks Nick. I actually wrote this program, almost exactly as you did.   
   Yours is a little more complex, but i wrote a copy file program.   
      
   I needed something to install (copy) a lib I am writing for my BBS programs   
   for shared code.   
      
      
   Thanks!   
      
      
      
   On 03 Sep 2022, Nick Andre said the following...   
       
    NA> On 02 Sep 22 21:22:49, Chad Adams said the following to All:   
    NA>    
    NA> CA> Does anyone know a function that will allow you to copy one file to an   
    NA> CA> location?   
    NA> CA>    
    NA> CA> CopyFile(File, File2);   
    NA>    
    NA> procedure SAFECOPY (fromFile, toFile : string);   
    NA> type bufferType = array [1..64] of char;   
    NA> type bufferTypePtr = ^bufferType; { Use the heap }   
    NA> var bufferPtr : bufferTypePtr; { for the buffer }   
    NA> f1, f2 : file;   
    NA> bufferSize, readCount, writeCount : word;   
    NA> fmSave : byte; { To store the filemode }   
    NA> begin   
    NA> bufferSize := SizeOf(bufferType);   
    NA> New (bufferPtr); { Create the buffer, on the heap }   
    NA> fmSave := FileMode; { Store the filemode }   
    NA> FileMode := 0; { To read also read-only files }   
    NA> Assign (f1, fromFile);   
    NA> {$I-} Reset (f1, 1); { Note the record size 1, important! }   
    NA> if IOResult <> 0 then exit; { Does the file exist? }   
    NA> Assign (f2, toFile);   
    NA> {$I-} Rewrite (f2, 1); { Open the target }   
    NA> if IOResult <> 0 then exit;   
    NA> repeat { Do the copying }   
    NA> BlockRead (f1, bufferPtr^, bufferSize, readCount);   
    NA> {$I-} BlockWrite (f2, bufferPtr^, readCount, writeCount);    
    NA> if IOResult <> 0 then begin close (f1); exit; end;   
    NA> until (readCount = 0) or (writeCount <> readCount);   
    NA> close (f1); close (f2);   
    NA> FileMode := fmSave; { Restore the original filemode }   
    NA> Dispose (bufferPtr); { Release the buffer from the heap }   
    NA> end; (* safecopy *)   
    NA>    
    NA> Nick   
    NA>    
    NA> --- Renegade vY2Ka2   
    NA> * Origin: Joey, do you like movies about gladiators? (1:229/426)   
      
   --Nugax   
   The ByteXchange BBS   
   TBX Software   
      
   --- Mystic BBS v1.12 A48 2022/07/15 (Linux/64)   
    * Origin: The ByteXchange BBS | bbs.thebytexchange.com (1:19/37)   
   SEEN-BY: 1/19 123 15/0 16/0 19/37 90/1 106/201 114/709 120/340 123/130   
   SEEN-BY: 123/131 129/305 331 153/7715 203/0 218/700 221/0 227/114   
   SEEN-BY: 229/111 112 113 206 275 317 400 424 426 428 470 550 616 664   
   SEEN-BY: 229/700 240/5832 266/512 282/1038 292/854 317/3 320/119 219   
   SEEN-BY: 320/319 322/0 757 326/101 342/200 396/45 460/58 633/280 712/848   
   PATH: 19/37 320/219 229/426   
      
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca