Subject: Re: bug#10733: 24.0.93; w32 file truncation

From: Eli Zaretskii <[email-masked]>
Date: Mon, 06 Feb 2012 23:09:46 +0200

> From: Lars Ingebrigtsen <[email-masked]>
> Cc: <[email-masked]>,  [email-masked],  [email-masked],  [email-masked]
> Date: Mon, 06 Feb 2012 21:24:04 +0100
> 
> "Ota, Takaaki" <[email-masked]> writes:
> 
> > where "memo" is the NTFS symlink and "memo.old" is a real file.  I
> > don't know how the size 0 on symlink side is translated into 64K.
> 
> If Emacs doesn't know the size of the file (i.e., the fs says that the
> file is 0 bytes long), then Emacs will only read the first 64K of the
> file.  This was discussed in the bug report about how /proc files are
> truncated by Emacs.
> 
> The fix proposed there (i.e., "read until you get to eof") would
> probably fix this, too.

That's a band-aid at best.  If Emacs doesn't know the size of the file
that is the target of the symlink and its other attributes, other
places will break.

What is needed is to resolve the link, i.e. do the equivalent of
`lstat'.