json is empty after a hard reboot

Viewed 32

im using Jackson object mapper to save a json file into a raspberry pi file file is ok and is filled with data until i unplug the power to it. after plugging it back and checking the file it is empty.

    public static <T> void serialize(Path path, T object, Class<T> ref, StdSerializer<T> serializer) throws IOException {
    ObjectMapper objectMapper = new ObjectMapper();
    SimpleModule module = new SimpleModule();
    module.addSerializer(ref, serializer);
    objectMapper.registerModule(module);

    objectMapper.writerWithDefaultPrettyPrinter().writeValue(new File(path.toString()), object);
}
1 Answers

As noted to me above the problem was the fat filesystem when moving the save location into the home directory the problem didn't occur

Related