Ticket #1968 (new enhancement) — at Initial Version

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

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);
}
Note: See TracTickets for help on using tickets.