Skip to content

append mode in open() is not posix #3374

@vtjnash

Description

@vtjnash
f = open("filename.txt", "a+")
println(f, "super\ncali\nfragilistic")
close(f)
f = open("filename.txt", "a+")
a = readall(f)
assert(length(a) > 0) # bug 1 -- not posix compliant
seek(a,0)
a = readall(f)
println(f,"hi") # bug 2 -- file is now twice as long as it should be
flush(f)
close(f)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorioInvolving the I/O subsystem: libuv, read, write, etc.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions