Skip to content
This repository was archived by the owner on Nov 15, 2019. It is now read-only.
This repository was archived by the owner on Nov 15, 2019. It is now read-only.

Config is read one byte at a time #865

@povilasb

Description

@povilasb

I was investigating my problems regarding crust configs using strace and as a side effect I noticed such syscall log:

open("/home/povilas/maidsafe/crust/target/debug/examples/sample.config", O_RDONLY|O_CLOEXEC) = 10
ioctl(10, FIOCLEX)                      = 0
flock(10, LOCK_SH)                      = 0
read(10, "{", 1)                        = 1
read(10, "\n", 1)                       = 1
read(10, " ", 1)                        = 1
read(10, " ", 1)                        = 1
read(10, "\"", 1)                       = 1
read(10, "h", 1)                        = 1
read(10, "a", 1)                        = 1
read(10, "r", 1)                        = 1
read(10, "d", 1)                        = 1
read(10, "_", 1)                        = 1
read(10, "c", 1)                        = 1
read(10, "o", 1)                        = 1
read(10, "d", 1)                        = 1
read(10, "e", 1)                        = 1
read(10, "d", 1)                        = 1
read(10, "_", 1)                        = 1
read(10, "c", 1)                        = 1
read(10, "o", 1)                        = 1
read(10, "n", 1)                        = 1
read(10, "t", 1)                        = 1
read(10, "a", 1)                        = 1
read(10, "c", 1)                        = 1
read(10, "t", 1)                        = 1
read(10, "s", 1)                        = 1

The config is read byte by byte. It doesn't look like the most efficient way to do it.
Was this behavior intended for some reasons?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions