chiark / gitweb /
actually do version protocol; use tempfile to stop exec truncating our binary ppm
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 4 Jul 2009 19:29:15 +0000 (20:29 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Sat, 4 Jul 2009 19:29:15 +0000 (20:29 +0100)
pctb/README.files
pctb/dictionary-manager

index 76229136c61e8cc2850a69529533d14211f628a4..254217a6d58e6200b0fb8007d781c451ad076332 100644 (file)
@@ -77,6 +77,7 @@ The program reads and writes the following files:
  * <file>.tmp
 
    When any of these tools overwrite one of the persistent dictionary
-   files, they temporarily write to <file>.tmp.
+   files, they temporarily write to <file>.tmp.  We also use a couple
+   of other temporary files.
 
 Future versions may have more helpers and more data files.
index 0ecad0ddad8a38bb444e9cb912e0f79e96c9dd2d..d9de00cb99da21296c1142952e15a2eb4961e23c 100755 (executable)
@@ -517,7 +517,7 @@ proc upload_status {} {
 }
 
 proc maybe_upload_entry {im def} {
-    global reqkind privacy_setting env dbname quiet
+    global reqkind privacy_setting env dbname quiet aadepth
 
     debug "DB-UPDATE PRIVACY $privacy_setting"
     if {!$privacy_setting} return
@@ -526,6 +526,8 @@ proc maybe_upload_entry {im def} {
 
     set pl {}
     lappend pl dict $dbname
+    lappend pl version 3
+    lappend pl depth $aadepth
 
     if {$privacy_setting>=2} {
        set pirate [string totitle $env(YPPSC_PIRATE)]
@@ -693,9 +695,11 @@ proc char_read_pgm {f} {
        append o $ointerl
     }
 
-#    debug "DATA $o"
-    set data [exec pnmscale 1 << $o]
-    image create photo image/main -data $data
+    debug "DATA1 $o"
+    set tmpfile ./#dictimage#.tmp
+    exec pnmscale 1 << $o >$tmpfile
+    image create photo image/main -file $tmpfile
+    file delete $tmpfile
 }
 
 #---------- character set editor display ----------