<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Files on Nalar</title>
    <link>https://nalar.dev/tags/files/</link>
    <description>Recent content in Files on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 01 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/files/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Atomic File Writes in Go: Prevent Partial and Corrupted Files</title>
      <link>https://nalar.dev/atomic-file-writes-in-go/</link>
      <pubDate>Tue, 01 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/atomic-file-writes-in-go/</guid>
      <description>&lt;p&gt;Writing a file with &lt;code&gt;os.WriteFile&lt;/code&gt; is simple, but it is not always the safest choice for configuration files, generated metadata, caches, state files, or other data that must never be left half-written.&lt;/p&gt;&#xA;&lt;p&gt;If a process crashes or the machine loses power while a file is being replaced, readers may observe incomplete content. A common way to reduce this risk is an &lt;strong&gt;atomic file write&lt;/strong&gt;: write the new content to a temporary file first, then replace the destination with a rename.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
