implemented local file and directory stream