A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01126.html below:

how to reading 0 byte files properly

Hi devs!

I've been trying using emacs to view some files mounted by FUSE. Sadly file attr in the system says the file size is 0 bytes, just like files under /proc

emacs can open the file but only can open it partially. I've checked the code to handle find-file and narrow down to 

```c

/* emacs/src/fileio.c:4587 */

if (seekable || !NILP (end))

 total = end_offset - beg_offset;

else

 /* For a special file, all we can do is guess.  */

 total = READ_BUF_SIZE;

```

Judging from the code, it assume the total size would be READ_BUF_SIZE

which seems to be not a very big number ( or not, I'm not sure)

```c

/* emacs/src/fileio.c:3692 */

enum { READ_BUF_SIZE = MAX_ALLOCA };

```


```h

/* emacs/src/lisp.h:5300 */

enum MAX_ALLOCA { MAX_ALLOCA = 16 * 1024 };

```


since vscode, vim, cat, and less can read this file properly, I would like to clarify whether it is a bug to fix or there another way to open a big file like this (say the actual size is 2MB~ but showing as 0 byte on stat)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4