A little detail might be useful.
What kind of file? Does the file already exist or are you trying to create it?
Do you want to open it with an existing application or are you writing code. If the former, which application? If the latter, which language are you using?