| 1480 | see also init_fps. */ |
| 1481 | |
| 1482 | static bool |
| 1483 | open_file (char *name, COLUMN *p) |
| 1484 | { |
| 1485 | if (streq (name, "-")) |
| 1486 | { |
| 1487 | p->name = _("standard input"); |
| 1488 | p->fp = stdin; |
| 1489 | have_read_stdin = true; |
| 1490 | } |
| 1491 | else |
| 1492 | { |
| 1493 | p->name = name; |
| 1494 | p->fp = fopen (name, "r"); |
| 1495 | } |
| 1496 | if (p->fp == NULL) |
| 1497 | { |
| 1498 | failed_opens = true; |
| 1499 | if (!ignore_failed_opens) |
| 1500 | error (0, errno, "%s", quotef (name)); |
| 1501 | return false; |
| 1502 | } |
| 1503 | fadvise (p->fp, FADVISE_SEQUENTIAL); |
| 1504 | p->status = OPEN; |
| 1505 | p->full_page_printed = false; |
| 1506 | ++total_files; |
| 1507 | return true; |
| 1508 | } |
| 1509 | |
| 1510 | /* Close the file in P. |
| 1511 | |