Added function selectfile and selectpipe