How to obtain filename along with the path from FileSpec object?

Q:

We are trying to get path of the file for the actions (GoToR,
e_Launch, e_URI) using GetFilePath (). This method is returning only
filename (not the full path).

We tried with the following code,

Obj file_dict = action.GetSDFObj().Get("F").Value();
FileSpec file_spec = new FileSpec(file_dict);
String file_path = file_spec.GetFilePath();

We feel that GetFilePath () can return filename along with the path,
but it is returning only filename.
----

A:

Currently file_spec.GetFilePath() returns the value from the file
specification dictionary. It could be a full file-path, but more often
it is a relative path or simply a filename (if the referred PDF is in
the same folder as the currently open document).

In any case, you can always infer the full file-path by taking the
folder/directory path of the source document and appending the
relative path (returned by GetFilePath()). I believe that .NET
Framework offers some API-s that can help you to build the path.

There are several reasons why GetFilePath() can't return the full
path. For example, using PDFNet it is possible to dynamically generate
or modify PDF documents (all in memory) and in these cases PDFNet
can't build the full path without the application specific knowledge.
In some cases the application may want only the relative path and not
the full path, etc.