Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't view device files #1777

Open
mc-butler opened this issue Nov 1, 2009 · 4 comments
Open

Can't view device files #1777

mc-butler opened this issue Nov 1, 2009 · 4 comments
Labels
area: mcview mcview, the built-in text editor prio: low Minor problem or easily worked around ver: 4.7.0-pre4 Reproducible in version 4.7.0-pre4

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/1777
Reporter gotar (gotar@….pl)

Trying to view some device an error is reported:
Cannot view: not a regular file
In my opinion this should be only a warning and such operation could continue if desired as it worked a long time and a few versions before.

...

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);
}
@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 11, 2009 at 9:04 UTC (comment 1)

  • Type changed from defect to enhancement

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Jan 19, 2010 at 6:34 UTC (comment 2)

  • Description edited

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 2, 2011 at 12:27 UTC (comment 3)

  • Milestone changed from 4.7 to Future Releases
  • Branch state set to no branch

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Feb 21, 2025 at 7:28 UTC (comment 4)

Ticket #1968 has been marked as a duplicate of this ticket.

@mc-butler mc-butler marked this as a duplicate of #1968 Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcview mcview, the built-in text editor prio: low Minor problem or easily worked around ver: 4.7.0-pre4 Reproducible in version 4.7.0-pre4
Development

No branches or pull requests

1 participant