0 Byte Files?

Martin McCormick martin at dc.cis.okstate.edu
Mon Nov 29 21:39:27 UTC 2004

	Be sure to check syslog if it exists and /var/log/messages.
Sometimes, when the file system is full or there is some other reason
for the file system to be broken, you can open files but not write
anything to them.  I have seen this behavior on other UNIX systems,
but not necessarily Linux.  I remember a system we were using for
logging that was either AIX or Sunos that filled up and started doing
exactly this sort of thing, causing us to loose everything that was
supposed to be stored there.

	The operating system can open files for either read-only,
write-only, append or both reading and writing.  When it opens a file
for writing, it first sets the pointer to 0, meaning that the file is
clean and clear of previous data.  If it opens for appending, the file
pointer is moved to the present EOF marker and that marker is
destroyed.  Your next write to that file starts just after the end of
the last character.

	When using cp or ftp, the new file starts out with 0 length
and is supposed to grow.  When the file system is broken in some way,
the OS may not be able to find any free blocks to write to and you are
stuck with a useless 0-length file.

	Also, to expand on what someone else suggested about the
clock, try doing a date -u command.  This will give you the Greenwich
Mean Time date.  If that time miraculously turns out to be your
current local time, then you've solved that mystery.

Hart Larry writes:
>Hi All:  Some days ago I asked this on blind-l and some individuals, but so fa
>no clues.  Either when useing ncftp to download or moving mp3s into a 
>sub-directory, all the files become 0 bytes.  This has happened twice.  Could 
>this be a false indication, where the files would show up in windows?  I know 
>have other hardware issues such as my pc clock several hours slow--and a d 
>drive with a directory which freezes the machine.  Thanks so much in advance 
>for any suggestions
>Blinux-list mailing list
>Blinux-list at redhat.com

More information about the Blinux-list mailing list