📄 mkisofs.c
字号:
#ifdef HAVE_SBRK unsigned long mem_start;#endif struct stat statbuf; char *merge_image = NULL; struct iso_directory_record *mrootp = NULL; struct output_fragment *opnt; int longind; char shortopts[OPTION_COUNT * 3 + 2]; struct option longopts[OPTION_COUNT + 1]; int c; int n; char *log_file = 0; char *node; char *pathnames = 0; FILE *pfp = NULL; char pname[1024], *arg; char nodename[1024]; int use_graft_ptrs = 0; int no_path_names = 1; int warn_violate = 0; int have_cmd_line_pathspec = 0;#ifdef APPLE_HYB char *afpfile = ""; /* mapping file for TYPE/CREATOR */ int hfs_ct = 0; char *root_info = 0;#endif /* APPLE_HYB */#ifdef __EMX__ /* This gives wildcard expansion with Non-Posix shells with EMX */ _wildcard(&argc, &argv);#endif save_args(argc, argv); if (argc < 2) {#ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Missing pathspec.\n");#endif usage(1); } /* Get the defaults from the .mkisofsrc file */ read_rcfile(argv[0]); outfile = NULL; /* * Copy long option initialization from GNU-ld. */ /* * Starting the short option string with '-' is for programs that * expect options and other ARGV-elements in any order and that care * about the ordering of the two. We describe each non-option * ARGV-element as if it were the argument of an option with * character code 1. */ { int i, is, il; shortopts[0] = '-'; is = 1; il = 0; for (i = 0; i < OPTION_COUNT; i++) { if (ld_options[i].shortopt != '\0') { shortopts[is] = ld_options[i].shortopt; ++is; if (ld_options[i].opt.has_arg == required_argument || ld_options[i].opt.has_arg == optional_argument) { shortopts[is] = ':'; ++is; if (ld_options[i].opt.has_arg == optional_argument) { shortopts[is] = ':'; ++is; } } } if (ld_options[i].opt.name != NULL) { longopts[il] = ld_options[i].opt; ++il; } } shortopts[is] = '\0'; longopts[il].name = NULL; } while ((c = getopt_long_only(argc, argv, shortopts, longopts, &longind)) != EOF) switch (c) { case 1: /* A filename that we take as input. */ optind--; have_cmd_line_pathspec = 1; goto parse_input_files; case OPTION_USE_GRAFT: use_graft_ptrs = 1; break; case 'C': /* * This is a temporary hack until cdrecord gets the * proper hooks in it. */ cdrecord_data = optarg; break; case OPTION_GUI: gui++; break; case 'i':#ifdef USE_LIBSCHILY comerrno(EX_BAD, "-i option no longer supported.\n");#else fprintf(stderr, "-i option no longer supported.\n"); exit(1);#endif break; case OPTION_ISO_LEVEL: iso9660_level = atoi(optarg); switch (iso9660_level) { case 1: /* * Only on file section * 8.3 d or d1 characters for files * 8 d or d1 characters for directories */ break; case 2: /* * Only on file section */ break; case 3: /* * No restrictions */ break; default: comerrno(EX_BAD, "Illegal iso9660 Level %d, use 1..3.\n", ucs_level); } break; case 'J': use_Joliet++; break; case OPTION_JCHARSET: jcharset = optarg; use_Joliet++; break; case OPTION_NOBAK: all_files = 0; break; case 'b': use_eltorito++; boot_image = optarg; /* pathname of the boot image on disk */ if (boot_image == NULL) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Required Eltorito boot image pathname missing\n");#else fprintf(stderr, "Required Eltorito boot image pathname missing\n"); exit(1);#endif } get_boot_entry(); current_boot_entry->boot_image = boot_image; break; case OPTION_ALT_BOOT: /* * Start new boot entry parameter list. */ new_boot_entry(); break; case 'B': use_sparcboot++; /* list of pathnames of boot images */ scan_sparc_boot(optarg); break; case 'G': use_genboot++; /* pathname of the boot image on disk */ genboot_image = optarg; if (genboot_image == NULL) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Required generic boot image pathname missing\n");#else fprintf(stderr, "Required generic boot image pathname missing\n"); exit(1);#endif } break; case OPTION_SPARCLABEL: /* Sun disk label string */ sparc_boot_label(optarg); break; case 'c': use_eltorito++; /* pathname of the boot image on cd */ boot_catalog = optarg; if (boot_catalog == NULL) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Required boot catalog pathname missing\n");#else fprintf(stderr, "Required boot catalog pathname missing\n"); exit(1);#endif } break; case OPTION_ABSTRACT: abstract = optarg; if (strlen(abstract) > 37) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Abstract filename string too long\n");#else fprintf(stderr, "Abstract filename string too long\n"); exit(1);#endif }; break; case 'A': appid = optarg; if (strlen(appid) > 128) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Application-id string too long\n");#else fprintf(stderr, "Application-id string too long\n"); exit(1);#endif }; break; case OPTION_BIBLIO: biblio = optarg; if (strlen(biblio) > 37) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Bibliographic filename string too long\n");#else fprintf(stderr, "Bibliographic filename string too long\n"); exit(1);#endif }; break; case OPTION_CHECK_OLDNAMES: check_oldnames++; break; case OPTION_COPYRIGHT: copyright = optarg; if (strlen(copyright) > 37) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Copyright filename string too long\n");#else fprintf(stderr, "Copyright filename string too long\n"); exit(1);#endif }; break; case 'd': omit_period++; warn_violate++; break; case 'D': RR_relocation_depth = 32767; break; case 'f': follow_links++; break; case 'l': full_iso9660_filenames++; break; case OPTION_MAX_FILENAMES: iso9660_namelen = MAX_ISONAME; /* allow 37 chars */ full_iso9660_filenames++; omit_version_number++; warn_violate++; break; case 'L': allow_leading_dots++; warn_violate++; break; case OPTION_LOG_FILE: log_file = optarg; break; case 'M': merge_image = optarg; break; case 'N': omit_version_number++; warn_violate++; break; case OPTION_NO_RR: no_rr++; break; case 'o': outfile = optarg; break; case OPTION_PAD: dopad++; break; case OPTION_P_LIST: pathnames = optarg; break; case 'p': preparer = optarg; if (strlen(preparer) > 128) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Preparer string too long\n");#else fprintf(stderr, "Preparer string too long\n"); exit(1);#endif }; break; case OPTION_PRINT_SIZE: print_size++; break; case 'P': publisher = optarg; if (strlen(publisher) > 128) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Publisher string too long\n");#else fprintf(stderr, "Publisher string too long\n"); exit(1);#endif }; break; case OPTION_QUIET: verbose = 0; break; case 'R': use_RockRidge++; break; case 'r': rationalize++; use_RockRidge++; break;#ifdef SORTING case OPTION_SORT: do_sort++; add_sort_list(optarg); break;#endif /* SORTING */ case OPTION_SPLIT_OUTPUT: split_output++; break; case OPTION_SYSID: system_id = optarg; if (strlen(system_id) > 32) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "System ID string too long\n");#else fprintf(stderr, "System ID string too long\n"); exit(1);#endif }; break; case OPTION_TRANS_TBL: trans_tbl = optarg; /* fall through */ case 'T': generate_tables++; break; case OPTION_UCS_LEVEL: ucs_level = atoi(optarg); if (ucs_level < 1 || ucs_level > 3) comerrno(EX_BAD, "Illegal UCS Level %d, use 1..3.\n", ucs_level); break; case OPTION_USE_FILEVERSION: use_fileversion++; break; case 'U': /* * Minimal (only truncation of 31+ characters) * translation of filenames. * * Forces -l, -d, -L, -N, -relaxed-filenames, * -allow-lowercase, -allow-multidot * * This is for HP-UX, which does not recognize ANY * extentions (Rock Ridge, Joliet), causing pain when * loading software. pfs_mount can be used to read the * extensions, but the untranslated filenames can be * read by the "native" cdfs mounter. Completely * violates iso9660. */ full_iso9660_filenames++; /* 31 chars */ omit_period++; /* trailing dot */ allow_leading_dots++; omit_version_number++; relaxed_filenames++; /* all chars */ allow_lowercase++; /* even lowcase */ allow_multidot++; /* > 1 dots */ warn_violate++; break; case OPTION_RELAXED_FILENAMES: relaxed_filenames++; warn_violate++; break; case OPTION_ALLOW_LOWERCASE: allow_lowercase++; warn_violate++; break; case OPTION_ALLOW_MULTIDOT: allow_multidot++; warn_violate++; break; case OPTION_ISO_TRANSLATE: iso_translate = 0; warn_violate++; break; case 'V': volume_id = optarg; if (strlen(volume_id) > 32) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Volume ID string too long\n");#else fprintf(stderr, "Volume ID string too long\n"); exit(1);#endif }; break; case OPTION_VOLSET: volset_id = optarg; if (strlen(volset_id) > 128) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Volume set ID string too long\n");#else fprintf(stderr, "Volume set ID string too long\n"); exit(1);#endif }; break; case OPTION_VOLSET_SIZE: volume_set_size = atoi(optarg); break; case OPTION_VOLSET_SEQ_NUM: volume_sequence_number = atoi(optarg); if (volume_sequence_number > volume_set_size) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Volume set sequence number too big\n");#else fprintf(stderr, "Volume set sequence number too big\n"); exit(1);#endif } break; case 'v': verbose++; break; case 'z':#ifdef VMS#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Transparent compression not supported with VMS\n");#else fprintf(stderr, "Transparent compression not supported with VMS\n"); exit(1);#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -