Skip to content

Open GGUF file in read/write mode is not a good idea #29

Description

@corradomio

To use gguf-tools in Windows doesn't work. The problem is to open the file in READ/WRITE/APPEND mode instead than READ_ONLYMODE.
There are TWO lines to update:

"gguflib.c":
routine: gguf_ctx *gguf_open(const char *filename)
int fd = open(filename,O_RDWR|O_APPEND); --> int fd = open(filename,O_RDONLY);

routine: int gguf_remap(gguf_ctx *ctx)
mmap(0,sb.st_size,PROT_READ|PROT_WRITE,MAP_SHARED,ctx->fd,0); --> mmap(0,sb.st_size,PROT_READ,MAP_SHARED,ctx->fd,0);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions