added getopt and options for file and link directories