How do i make an arduino Uno and Mega create files to a usb connected Rasspberry

I'm making a program that will run on a Raspberry Pi 2 B. Now i want my Arduino to be able to read a pin and state if the pin state is high then it will create a file! If the state is low then i want it to delete the file! I also want the Arduino to be able to change state of an output if it finds a certain file.

Any help about the subject is deeply appreciated. : D

Sounds like arduino is going to do all the work what do you need the pi for LOL.

Did you try to search the internet? 'raspberry pi arduino usb' is an excellent search term.

http://www.seeedstudio.com/recipe/166-basic-pi-lt-gt-arduino-communication-over-usb.html will probably do what you want.