- /* Open file handle. */
- if (!fh_open (fh, FH_REF_FILE, "portable file", "we"))
- return NULL;
-
- /* Create file. */
- mode = S_IRUSR | S_IRGRP | S_IROTH;
- if (opts.create_writeable)
- mode |= S_IWUSR | S_IWGRP | S_IWOTH;
- file = create_stream (fh_get_file_name (fh), "w", mode);
- if (file == NULL)
- {
- fh_close (fh, "portable file", "we");
- msg (ME, _("An error occurred while opening \"%s\" for writing "
- "as a portable file: %s."),
- fh_get_file_name (fh), strerror (errno));
- return NULL;
- }
-