From Yves Larochelle on Mon, 14 Dec 1998
I have a simple problem. I run a FORTRAN program that makes calls to a C library to read data from a DLT SCSI tape drive. Everything is fine when I run from a drive on my host machine.
Oddly enough I was just writing in my book about how the tape drives under Unix (and Linux) are available for general purpose spooling of applications data sets (like the old mainframe spooling and job control model) but are rarely used in this fashion. It's amusing to see that someone is doing this.
But I haven't been able to open/read the tape drive on a remote host. I have read your previous answers on remote tape access:
but it doesn't solve my problem.
I want to use local memory and CPU, so "rsh" is not an option. In my C library I have tried to change:
> fd = open ("/dev/st0", flag, 0); > ... to: > fd = open ("remotehost:/dev/st0", flag, 0); > or even: > fd = open ("operator@remotehost:/dev/st0", flag, 0);
Open failed on tape No such file or directory
Yep. That's right. Inspection of the code for 'tar' and 'cpio' would reveal that these do use an implicity 'rsh' to the remote host, and pipe their data streams over TCP connections thereto.
This ability to access devices remotely is not built into the C libraries, it is built by your program through the native network mechanisms (or at least via judicious use of the 'system()' library call).
I do have setup /etc/hosts.equiv (and /$HOME/.rhosts) so I can access my account on the remote host without password
I have been told to use "rmt", but how to do it within the C library ??
I don't know much about 'rmt' but you can pick up the 'dump' package in which it is included and read the man page therefrom. I'd pick up the sources to that package so you can read some sample source code to understand how 'dump' uses it.
(Obviously if you want to actually cut and paste the source code for use in your project, you'll want to read and comply with the license --- probably GPL. This may be of no consequence if you won't be redistributing your program --- and should be know problem if you're willing to release your sources under a compatible license. It should also be no problem if you read these sources to gain and understanding of the API's and code your own functions. However, read the license for yourself).
Can you help me with this one ???
Since I'm not a programmer --- not much directly. However, as I've said, you can study examples of this sort of code in the 'tar', 'cpio', and 'dump' sources.
If at all possible,
... (e-mail ellided)
I always respond via e-mail whenever I respond at all. The mark-up to HTML is done at the end of each month by my lovely assistant (and wife), Heather.