improve cursor management
use same binary than file