File output questions

OK, I'm a relative newbie, but I have a couple of specific questions:

How can I get the file paths/names result from a multi-layered render?

How do I get MEL to create a file on disk, like creat in C?

Thanks for any help!