<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Michael Roeschter on foojay.io - Friends of OpenJDK</title><link>https://foojayio.github.io/website/today/author/michael-roeschter/</link><description>Articles written by Michael Roeschter on foojay.io - Friends of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 11 Feb 2021 09:12:23 +0000</lastBuildDate><atom:link href="https://foojayio.github.io/website/today/author/michael-roeschter/index.xml" rel="self" type="application/rss+xml"/><item><title>Safe Writing to Files in IoT and Industrial Systems</title><link>https://foojayio.github.io/website/today/safe-writing-to-files-in-iot-and-industrial-systems/</link><pubDate>Thu, 11 Feb 2021 09:12:23 +0000</pubDate><guid>https://foojayio.github.io/website/today/safe-writing-to-files-in-iot-and-industrial-systems/</guid><description>&lt;p&gt;Especially on IoT devices, file corruption on shutdown is a common concern. This article discusses how to write to disk safely in Java, combining disk sync, shutdown hooks, and atomic renaming of files.&lt;/p&gt;
&lt;h3 id="h3-0-files-on-disk-can-still-easily-become-corrupted"&gt;Files On Disk Can Still Easily Become Corrupted&lt;/h3&gt;
&lt;p&gt;For performance optimization, file systems write to disks asynchronously resulting in potential corruption when a hard system shutdowns occurs through power off or crashes.&lt;/p&gt;
&lt;p&gt;As this has become a rare experience for desktop and server users, it comes as a surprise to many developers working on IoT devices and industrial computers that hard power cuts are a common operational scenario and storage is far less robust than expected.&lt;/p&gt;</description></item></channel></rss>