Re: bug: :if-exists :append

Sam Steingold <[email protected]>
Newsgroups gmane.lisp.clisp.general
Message-ID <m1efz1zt63.fsf@clr-sds>
> * Jean Louis <[email protected]> [2017-02-13 22:20:58 +0300]:
>
> On Mon, Feb 13, 2017 at 01:51:10PM -0500, Sam Steingold wrote:
>> When I click on "Create Ticket" on https://sourceforge.net/p/clisp/bugs/,
>> I am redirected to https://sourceforge.net/p/clisp/bugs/new/
>> What happens to you?
>
> I guess I don't have account there. I have account only on mailing
> list. Not that I am fond of sourceforge especially for GNU projects.

Indeed, you need an account.
Please do get it.
We appreciate your bug reports.

> OK, if you happen to know how to get file descriptor by sys:: let me
> know. Or how to append to file which is chattr +a

(require "linux")
(defparameter *my-stream*
  (ext:make-stream (linux:open filename (logior linux::O_APPEND linux::O_RDONLY) 0)
                   :direction :append ...))


> I have tried that with SBCL and it appended to the file

interesting - what does my lisp code below do in SBCL?


>> --8<---------------cut here---------------start------------->8---
>> (with-open-file (s "my-append-only-file" :direction :output :if-exists :append)
>>   (let ((pos (file-position s)))
>>     (write-string "foo" s)
>>     (file-position s (- pos 3))
>>     (write-string "bar" s)))
>> --8<---------------cut here---------------end--------------->8---
>> 
>> ANSI CL mandates that this appends 3 chars "bar" to
>> "my-append-only-file".
>> However, if "my-append-only-file" was opened with `O_APPEND`, it will
>> actually append 6 chars "foobar".


-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504
http://steingoldpsychology.com http://www.childpsy.net https://ffii.org
https://jihadwatch.org http://honestreporting.com http://www.dhimmitude.org
Selling grief is easier than buying happiness.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
clisp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.