Changeset 123


Ignore:
Timestamp:
Dec 4, 2009 5:00:47 PM (11 years ago)
Author:
toby
Message:

# on 1999/11/19 00:03:25, toby did:
fixup Archive code for Windows (as per Pamela Whitfield)
make autoload option UNIX only (until we can run GSAS pgms synchronously)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expgui

    • Property rcs:date changed from 1999/11/16 15:59:22 to 1999/11/19 00:03:25
    • Property rcs:lines changed from +39 -46 to +15 -27
    • Property rcs:rev changed from 1.21 to 1.22
    r118 r123  
    399399    if {$tcl_platform(platform) != "windows"} {
    400400        puts $fp "set env(GSASBACKSPACE) $env(GSASBACKSPACE)"
    401     }
    402     puts $fp "set expgui(autoexpload) $expgui(autoexpload)"
     401        puts $fp "set expgui(autoexpload) $expgui(autoexpload)"
     402    }
    403403    close $fp
    404404}
     
    489489        set expnam [file rootname $expgui(expfile)]
    490490        if {$tcl_platform(platform) == "windows"} {
     491            set version -1
     492            catch {source $expnam.version}
     493            incr version
    491494            if ![file executable [file join $expgui(scriptdir) pkzip.exe]] {
    492495                # archive w/o pkzip
    493                 set files [glob -nocomplain ${expnam}!*.EXP]
    494                 if {$files == ""} {
    495                     set num -1
    496                 } else {
    497                     set file [lindex [lsort -decreasing $files] 0]
    498                     regexp {!0*([0-9]+)\.EXP} [string toupper $file] a num
    499                 }
    500                 set file $expnam![format "%3.3d" [incr num]].EXP
    501                 file copy $expnam.EXP $file
     496                set file $expnam![format "%3.3d" $version].EXP
     497                file copy -force $expnam.EXP $file
    502498                set fp [open $expnam.lst a]
    503499                puts $fp "\n--------------------------------------------------------------"
     
    511507                # PKZIP can't handle long dir names either
    512508                cd [set dir [file dirname $expnam]]
    513                 set num -1
    514                 # get the versions from the listing
    515                 if [file exists $sexp.zip] {
    516                     set fp [open "| [file join $expgui(scriptdir) pkzip.exe] -vb $sexp" r]
    517                     while {[gets $fp line] >= 0} {
    518                         regexp "$sexp\.0?0?(\[0-9\]+)" [string toupper $line] junk n
    519                         catch {if {$n > $num} {set num $n}}
    520                     }
    521                     close $fp
    522                 }
    523                 incr num
    524                 set file $sexp.[format "%3.3d" $num]
     509                set file $sexp.[format "%3.3d" $version]
    525510                file copy -force $expnam.EXP $file
    526                 exec [file join $expgui(scriptdir) pkzip.exe] -m $expnam $file > x.x &
     511                exec [file join $expgui(scriptdir) pkzip.exe] -m $sexp $file > zip.out &
    527512                set fp [open $expnam.lst a]
    528513                puts $fp "\n--------------------------------------------------------------"
     
    531516                close $fp
    532517            }
     518            set fp [open $expnam.version w]
     519            puts $fp "set version $version"
     520            close $fp
    533521        } else {
    534522            set files [glob -nocomplain $expnam.EXP.*]
     
    29402928    $expgui(fm).option.menu  add checkbutton -label "Override backspace" \
    29412929            -variable env(GSASBACKSPACE)
    2942 }
    2943 $expgui(fm).option.menu  add checkbutton -label "Autoload EXP" \
     2930    $expgui(fm).option.menu  add checkbutton -label "Autoload EXP" \
    29442931            -variable expgui(autoexpload)
     2932}
    29452933
    29462934$expgui(fm).option.menu add command -label "Save Options" -underline 1 \
Note: See TracChangeset for help on using the changeset viewer.