Question about signing a file, from my program

Is there another way, that I can sign a file from a program
other than using a command line?
I’m using powerbuilder… which most people don’t use these days
and, I need to sign a file before sending it to an ftp site

Is there any kind of function call, that I can use… to do this on a file?
I can make use of external functions in dll’s, as long as the dll is registered
the command line options seem cumbersome

The “officially” recommended way to automate crypto functions of GnuPG
is to use the library GPGME. I’m not sure if this is easier, though.
http://wiki.gnupg.org/APIs

would there be some “easy” examples of how to do this?

There are some examples in C within the current gpgme documentation (coming with the tarball). gpgme maybe a bit more low level than what you may want, but you could still try.

There are some python based examples that may even be more instructive coming with pyme, e.g. see http://pyme.cvs.sourceforge.net/viewvc/pyme/pyme/examples/sign.py?revision=1.3&view=markup