multithreading - Screen big data without interrupting data conversion -
this thread extension of thread interruption (ctrl-c) stop data transfer less. create similar system monitoring data conversion found in fdupes
. think can reached gnu screen
. tools tee
, buffers
may not needed skip 2 sections if want.
hex conversion , tee [skip if know]
you can use whatever hex dumper want task, instance hexdump -v
, od -v -t x1
, xxd -ps
generation of example data. can create binary test data 1gb following command, discussed here
dd if=/dev/urandom of=sample.bin bs=64m count=16
let's simplify old situation without while loop. assume have big file. put stin less
hexdump -v sample.bin | less -s -m +gg
i discussing here how generate big test files. big file, empty screen when not press anything, since conversion under way. when press ctrl-c
, data has been converted less @ bottom of screen. not data. interruption ctrl-c
end transfer of data file less?
possibilities fix this
- refresh less somehow if conversion still underway
- bind
tee
command here somehow
is there way avoid interruption of data conversion able stream. think tee
command 1 possibility.
buffers [i think not needed]
stdbuf -i0 -o0 -e0 xxd -ps sample.bin | stdbuf -i0 -o0 -e0 less -s -m +g
which not resolve problem. should able refresh output in less, using flag r
. interruption show in less
.
i did not manage unbuffer
command work stdbuf
, discussing here.
screen
i think best way have glimpse of data conversion run inside screen
. logic: give stdout less
inside screen
. scroll output in screen
. have completed such task before may found in thread screen
. have think once more again. create similar usability in command fdupes
. think tee
, buffer
may not needed.
how can create screen monitoring window when less viewing parallerly data conversion?
Comments
Post a Comment