files: give feedback while waiting for a FIFO to open up

This commit is contained in:
Benno Schulenberg 2019-05-18 19:09:02 +02:00
parent 1b2018e921
commit afbaf8ae2d

View File

@ -968,6 +968,9 @@ int open_file(const char *filename, bool newfie, bool quiet, FILE **f)
return -1;
}
if (S_ISFIFO(fileinfo.st_mode))
statusbar(_("Reading from FIFO..."));
/* Try opening the file. */
fd = open(full_filename, O_RDONLY);
@ -981,7 +984,7 @@ int open_file(const char *filename, bool newfie, bool quiet, FILE **f)
statusline(ALERT, _("Error reading %s: %s"), filename, strerror(errno));
close(fd);
} else if (!inhelp)
statusbar(_("Reading File"));
statusbar(_("Reading..."));
}
free(full_filename);
@ -1824,6 +1827,9 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
}
#endif /* !NANO_TINY */
if (stat(realname, &st) == 0 && S_ISFIFO(st.st_mode))
statusbar(_("Writing to FIFO..."));
if (f_open == NULL) {
/* Now open the file in place. Use O_EXCL if tmp is TRUE. This
* is copied from joe, because wiggy says so *shrug*. */
@ -1853,6 +1859,8 @@ bool write_file(const char *name, FILE *f_open, bool tmp,
}
}
statusbar(_("Writing..."));
while (fileptr != NULL) {
size_t data_len = strlen(fileptr->data), size;