The "frec" function redirect the system's input to a file. The function ends when the "kill key" (ESC) is received.