Ticket #1968 (closed enhancement: duplicate)

Opened 14 years ago

Last modified 14 years ago

mcview: need view blockdevice

Reported by: angel_il Owned by:
Priority: major Milestone:
Component: mcview Version:
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset:

Description (last modified by angel_il) (diff)

now it's forbidden

        if (!S_ISREG (st.st_mode)) {
            mc_close (fd);
            mcview_show_error (view, _(" Cannot view: not a regular file "));
            g_free (view->filename);
            view->filename = NULL;
            goto finish;
        }

and we have one problem - calculate filesize.
fstat return 0 for block devices...
as a workaround, we can use ftell like this

off_t mc_ftell (int fd)
{
    fseek(fd, 0L, SEEK_END);
    return ftell(fd);
}

Change History

comment:1 Changed 14 years ago by angel_il

  • Description modified (diff)

comment:2 Changed 14 years ago by angel_il

  • Status changed from new to closed
  • Resolution set to duplicate

comment:3 Changed 14 years ago by angel_il

dub: #1777

comment:4 Changed 14 years ago by andrew_b

  • Version version not selected deleted
  • Component changed from mc-core to mcview
  • Milestone 4.7 deleted
Note: See TracTickets for help on using tickets.