Update main.c

The changes has been done to get the directory path of the changed file.