save_json_to_file()

save_json_to_file()#

Save a JSON object to a file. Works with json_t *.

Prototype

PUBLIC int save_json_to_file(
    const char  *path,
    json_t      *json
);
        

Parameters

Key

Type

Description

path

const char *

The path to save the JSON file.

json

json_t *

The JSON object to save.


Return Value

Returns 0 on success, or a negative value on failure.

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples