Ticket #1968 (new enhancement) — at Version 1

Opened 15 years ago

Last modified 15 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 15 years ago by angel_il

  • Description modified (diff)
Note: See TracTickets for help on using tickets.