emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: feature request: view part of file


From: Eli Zaretskii
Subject: Re: feature request: view part of file
Date: Sat, 19 Jan 2013 15:47:43 +0200

> Date: Sat, 19 Jan 2013 04:47:58 -0800
> From: Paul Eggert <address@hidden>
> CC: address@hidden, address@hidden, address@hidden
> 
> It's a good idea for a couple of reasons.  First, the old code
> mishandled things if the file was renamed by some other process
> between the time that Emacs opened it and the time that
> file-regular-p invoked stat on it.  Second, the typical GNU style
> is that the behavior of a program should not depend on the type of
> output device.
> 
> I looked at the old change you mentioned, and it appears that
> there was a problem on DOS_NT with invoking lseek (fd, 0, SEEK_END) when
> FD is not a regular file.  Here's a patch that should avoid this problem:

Thanks.  I think this should go in, with one caveat:

> +  open_flags = O_WRONLY | O_BINARY | O_CREAT;
> +  open_flags |= EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC;
> +  if (NUMBERP (append))
> +    offset = file_offset (append);
> +  else if (!NILP (append))
> +    open_flags |= O_APPEND;

We cannot use O_TRUNC if the APPEND argument is non-nil, can we?  Or
did I misunderstand something?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]