Changes between Initial Version and Version 2 of Ticket #1777
- Timestamp:
- 01/19/10 06:34:42 (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1777
- Property Type changed from defect to enhancement
-
Ticket #1777 – Description
initial v2 2 2 Cannot view: not a regular file 3 3 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. 4 5 ... 6 7 now it's forbidden 8 {{{ 9 if (!S_ISREG (st.st_mode)) { 10 mc_close (fd); 11 mcview_show_error (view, _(" Cannot view: not a regular file ")); 12 g_free (view->filename); 13 view->filename = NULL; 14 goto finish; 15 } 16 }}} 17 18 and we have one problem - calculate filesize. 19 fstat return 0 for block devices... 20 as a workaround, we can use '''ftell''' like this 21 22 {{{ 23 off_t mc_ftell (int fd) 24 { 25 fseek(fd, 0L, SEEK_END); 26 return ftell(fd); 27 } 28 }}}