Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

ring print part of the content of a binary file

see "Testing: fread()" +" FileName: "+ exefilename() +nl +nl
fp = fopen(exefilename(),"rb")
r = fread(fp,800)
for n =1 to len(r)
        if isprint(substr(r, n, 1))
                see substr(r, n, 1)
        else
                see "."
        ok
        ### 80 char per line
        if n % 80 = 0
                see nl
        ok
next
fclose(fp)
Source by ring-lang.github.io #
 
PREVIOUS NEXT
Tagged: #ring #print #part #content #binary #file
ADD COMMENT
Topic
Name
4+9 =