-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Looking at the code I see that the print files are opened as follows:
static void printer_open(unsigned val)
{
switch(print_dest) {
case PDEST_NONE:
break;
case PDEST_STDOUT:
if (val) {
print_fp = stdout;
printer_outchar(val, print_fp);
}
break;
case PDEST_FILE_TEXT:
if (val)
printer_open_file(val, "wt");
break;
case PDEST_FILE_BIN:
printer_open_file(val, "rb");
break;
case PDEST_PIPE_TEXT:
if (val)
printer_open_pipe(val, "rt");
break;
case PDEST_PIPE_BIN:
printer_open_pipe(val, "rb");
}
}
I'm curious as to why the binary files and both pipes are opened in read mode. Should they all be opened in append mode which seems appropriate for a printer file?
Also what does the "t" mean in the mode string, it's not documented on either Linux or macOS as far as I can tell.
Metadata
Metadata
Assignees
Labels
No labels