Ignore:
Timestamp:
Oct 8, 2002, 11:19:42 AM (16 years ago)
Author:
kevin
Message:

optimized exec cat to fcopy in reinplace
ftruncate(2) original file after performing substitutions
added ftruncate(2) command to Pextlib.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r989 r992  
    325325    seek $input 0
    326326
    327     if {[catch {exec cat <@$output >@$input 2>/dev/null} error]} {
     327        # copy from strsed output back into the input
     328    if {[catch {fcopy $output $input} error]} {
    328329        ui_error "reinplace: $error"
    329330        close $output
     
    332333        return -code error "reinplace failed"
    333334    }
     335       
     336        set eof [file size "$tmpfile"]
     337        puts "$tmpfile $eof"
     338        ftruncate $input $eof
    334339
    335340    close $output
Note: See TracChangeset for help on using the changeset viewer.