Category : Network Files
Archive   : RJ.ZIP
Filename : RJ.C

 
Output of file : RJ.C contained in archive : RJ.ZIP
/****************************************************************/
/* */
/* rj.c 06/19/86 */
/* */
/* this program sends a command line to another network */
/* station for remote execution. The other network station */
/* must be running rjexec. A message will be returned and */
/* printed on the bottome line when the remote job is complete. */
/* */
/* rev 1.1 07/11/86 recompile to use revised semopen call */
/* */
/****************************************************************/

#include
#include "novell.h"

main(argc, argv)
int argc;
char *argv[];
{
int user_no;
int result, value, users;
unsigned long handle;
char station[64];
int i;
char cmnd_line[128], message[128];
long ltime, target_time;
char c;

printf("Remote job submission program -- Ver. 1.1\n");
printf("For Novell Netware\n");
printf("Copyright (c) 1986 -- Ken Hales\n\n");

/********************************************************/
/* make sure there is a command to send */
/********************************************************/

if (argc < 2) {
printf("Usage: rj \n");
exit(1);
}

/********************************************************/
/* find out who is running rjexec */
/********************************************************/

result = semopen("rj", 0, &handle, &users);

if (result != 0) {
printf("Problem opening semaphore: %d\n", result);
printf("Program aborted\n");
exit(1);
}

if (users < 2) {
printf("No workstation is currently running rjexec.\n");
printf("Program aborted\n");
semclose(handle);
exit(1);
}

result = semexam(handle, &value, &users);

if (result != 0) {
printf("Problem examining semaphore: %d\n", result);
printf("Program aborted\n");
semclose(handle);
exit(1);
}

/********************************************************/
/* open a message pipe to the remote job workstation */
/********************************************************/

station[0] = value;
pipopen(1, station);

/********************************************************/
/* send command to the remote job workstation by */
/* writing to its message pipe. */
/********************************************************/

strcpy(message, argv[1]);
for (i=2; i strcat(message, " ");
strcat(message, argv[i]);
}

station[0] = value;
pipwrite(1, station, message);

if (station[0] != 0) {
printf("Not successful.\n");
printf("Remote workstation queue is probably full.\n");
result = 1;
} else {
printf("Job has been successfully sent to remote workstation.\n");
result = 0;
}

/********************************************************/
/* done - close semaphore and pipe, then exit */
/********************************************************/

station[0] = value;
pipclose(1, station);
semclose(handle);
exit(result);
}


  3 Responses to “Category : Network Files
Archive   : RJ.ZIP
Filename : RJ.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/