I'm confused. Your title and the description of your post mention a pipe. Your code doesn't use pipes. And you want to find out the name of a link to your output file, which is to be created only after you run your program?
Perhaps you should make up your mind of what you want, and then we can see if it's even possible.
Comment on Re: Named Pipe, Linking to It and Knowing the Name of the Link