247{
250
251
252
253#ifdef OS_WINNT
255#elif defined(OS_UNIX)
257#elif defined(OS_VMS)
259#else
260#error This program cannot be compiled under this operating system
261#endif
262
263
265 cmd[0] = 0;
268
269
272
273
277 else if (
argv[
i][0] ==
'-') {
280 if (
argv[
i][1] ==
'f')
282 else if (
argv[
i][1] ==
'd')
284 else
286 } else if (cmd[0] == 0)
287 strcpy(cmd,
argv[
i]);
290 else
292 }
293
296
297
299
300 if (
strcmp(cmd,
"status") == 0) {
302 return 0;
303 }
304
305
308 return 0;
309 }
310
311 if (
strcmp(cmd,
"rewind") == 0)
313
314 else if (
strcmp(cmd,
"online") == 0)
316
317 else if (
strcmp(cmd,
"offline") == 0)
319
320 else if (
strcmp(cmd,
"eof") == 0 ||
strcmp(cmd,
"weof") == 0) {
321
325 return 0;
326 }
327
330 }
331
332 else if (
strcmp(cmd,
"fsf") == 0 ||
strcmp(cmd,
"ff") == 0)
334
335 else if (
strcmp(cmd,
"fsr") == 0 ||
strcmp(cmd,
"fr") == 0)
337
338 else if (
strcmp(cmd,
"bsf") == 0 ||
strcmp(cmd,
"bf") == 0)
340
341 else if (
strcmp(cmd,
"bsr") == 0 ||
strcmp(cmd,
"br") == 0)
343
344 else if (
strcmp(cmd,
"seod") == 0)
346
347 else if (
strcmp(cmd,
"dir") == 0)
349
350 else if (
strcmp(cmd,
"backup") == 0) {
351
355 return 0;
356 }
358 }
359
360 else if (
strcmp(cmd,
"restore") == 0)
362
363 else {
365 printf(
"usage: mtape [-f tape_device] [-d file] [-v] command [count] [last]\n\n");
366 printf(
"Following commands are available:\n");
367 printf(
" status Print status information about tape\n");
368 printf(
" rewind Rewind tape\n");
370 (" eof,weof Write <count> End-of-File marks at the current tape position\n");
371 printf(
" fsf,ff Forward spaces <count> files\n");
372 printf(
" fsr,fr Forward spaces <count> records\n");
373 printf(
" bsf,bf Backspaces <count> files\n");
374 printf(
" bsr,br Backspaces <count> records\n");
375 printf(
" rewind Rewind tape\n");
376 printf(
" offline Places the tape offline (unload)\n");
377 printf(
" online Places the tape online (load)\n");
378 printf(
" seod Space to end of recorded data\n\n");
379 printf(
"Following commands only work with tapes written in MIDAS format:\n");
380 printf(
" dir List next [count] runs on MIDAS tape\n");
383 (" Copy runs with numbers [count] to [last] from disk to tape.\n");
384 printf(
" If [-d file] is not given, runxxxxx.mid is used where\n");
385 printf(
" xxxxx is the run number. If [file] contains %%05d, it\n");
386 printf(
" is replaced by the run number.\n");
388 printf(
" Copy next [count] files from tape to disk.\n");
389 printf(
" If [-d file] is not given, runxxxxx.mid is used where\n");
390 printf(
" xxxxx is the run number. If [file] contains %%05d, it\n");
391 printf(
" is replaced by the run number.\n");
392 return 0;
393 }
394
396 printf(
"Error performing operation\n");
398 printf(
"Error performing operation, status code = %d\n",
status);
399
401
402 return 0;
403}
INT ss_tape_rskip(INT channel, INT count)
INT ss_tape_rewind(INT channel)
INT ss_tape_fskip(INT channel, INT count)
INT ss_tape_close(INT channel)
INT ss_tape_status(char *path)
INT ss_tape_mount(INT channel)
INT ss_tape_spool(INT channel)
INT ss_tape_unmount(INT channel)
INT ss_tape_write_eof(INT channel)
INT ss_tape_open(char *path, INT oflag, INT *channel)
INT cm_set_msg_print(INT system_mask, INT user_mask, int(*func)(const char *))
INT tape_dir(INT channel, INT count)
INT tape_backup(INT channel, INT count1, INT count2, char *file_name)
INT tape_restore(INT channel, INT count, char *file_name)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)