use self written directive for file handling