Create variable directory and incremetal files

@PaulS:
Thank you very much for the help, and I'm sorry for having written false things but I really didn't know that kind of code, I studied it at high school (C++), but not in a close way, so I really thank you for help, this will allow me to finish my project and do more complex project in future!