Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need to write a simple program called kv in C language. It is a simple persistent key-value store. The program will have a few

I need to write a simple program called "kv" in C language. It is a simple persistent key-value store.

The program will have a few options. The first is to insert some (key, value) pairs into the database. This is accomplished as follows:

```sh

prompt> ./kv

prompt> ./kv p,10,remzi

prompt> ./kv p,20,andrea p,40,someotherperson

```

```sh

prompt> ./kv g,10

10,remzi

prompt>

```

There are many many ways to implement such a feature. Here, we suggest something very simple. The idea will be to use a single file (called, say, `database.txt`), where you store all of this information in plain-text format.

```sh

prompt> cat database.txt

1,first

2,second

prompt>

```

CFLAGS=-O2 -Wall -Werror

This is Makefile

kv: kv.c

$(CC) -o kv $< $(CFLAGS)

test: kv

bash test-kv.sh

clean:

rm -f database.txt kv

rm -fr tests-out

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data 29th British National Conference On Databases Bncod 2013 Oxford Uk July 2013 Proceedings Lncs 7968

Authors: Dan Olteanu ,Georg Gottlob ,Christian Schallhart

2013th Edition

3642394663, 978-3642394669

More Books

Students also viewed these Databases questions

Question

Why cant people consciously recall learning to walk?

Answered: 1 week ago

Question

IN C programming language

Answered: 1 week ago

Question

Understanding Group Leadership Culture and Group Leadership

Answered: 1 week ago