OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [mips/] [ref4955/] [v2_0/] [misc/] [swap4.tcl] - Blame information for rev 174

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#!/bin/bash
2
# restart using a Tcl shell \
3
    exec sh -c 'for tclshell in tclsh tclsh83 cygtclsh80 ; do \
4
            ( echo | $tclshell ) 2> /dev/null && exec $tclshell "`( cygpath -w \"$0\" ) 2> /dev/null || echo $0`" "$@" ; \
5
        done ; \
6
        echo "swap4.tcl: cannot find Tcl shell" ; exit 1' "$0" "$@"
7
 
8
proc filter { input_file output_file } {
9
    set input_fd [open $input_file  "r"]
10
    set output_fd  [open $output_file "w"]
11
 
12
    fconfigure $input_fd  -translation binary
13
    fconfigure $output_fd -translation binary
14
    while { 1 } {
15
        set data [read $input_fd 4]
16
        if { [eof $input_fd] } {
17
            break
18
        }
19
        binary scan $data "i" var
20
        puts -nonewline $output_fd [binary format "I" $var]
21
    }
22
    close $input_fd
23
    close $output_fd
24
}
25
 
26
filter [lindex $argv 0] [lindex $argv 1]

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.