File descriptor

This commit adds the file descriptor and improve some source code

Signed-off-by: José Guilherme Vanz <guilherme.sft@gmai.com>