From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aharon Robbins Message-Id: <200303301036.h2UAaEFZ031353@localhost.localdomain> To: 9fans@cse.psu.edu Subject: [9fans] size on /proc files? Date: Sun, 30 Mar 2003 13:36:14 +0300 Topicbox-Message-UUID: 86e46254-eacb-11e9-9e20-41e7f4b1d025 Just out of curiousity, what does ls -l on special files in /proc report? On linux, e.g., /proc/filesystems shows up as a regular file, but of size zero. Yet when you cat it you get information. This behavior broke the current gawk, where I'd rewritten the get_a_record routines; they had a check: if (S_ISREG(sbuf.st_mode) && total > sbuf.st_size) flag |= AT_EOF; I had to change this to if (S_ISREG(sbuf.st_mode) && sbuf.st_size > 0 && total > sbuf.st_size) .... I am annoyed at the Linux behavior, but understand that the contents of these "files" can change dynamically, making the reporting of a size for stat difficult or impossible. So, I was just curious how Plan 9 handles it. Thanks, Arnold Robbins