i wrote a program that reads the content of a binary file and converts each
byte to a string containing its ascii value. and saves these strings to a
textfile (separated by newline s)
e.g.
imagine a file with this content:

Hello

the program then creates a file with the following content:

72
101
108
108
111

;
my program includes this code:

a: "" ; init an empty string
readtomem: read/binary %dummy.exe ; read the whole file dummy.exe into
memory
foreach num readtomem [
a: join a [num newline] ; add the ascii code as string to a, then add a
newline to a
]
write/append %dummy.txt  a; 

if %dummy.exe has a size of 88.000 Bytes then my script needs more than 100
MB of ram at runtime !!!
the problem seems to be the combination of a loop (foreach) and  a: join a
....

any ideas to replace a: join a ... with a less memory consuming alternative
???


Jean Holzammer

Reply via email to