<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Pathlib on Nalar</title>
    <link>https://nalar.dev/tags/pathlib/</link>
    <description>Recent content in Pathlib on Nalar</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Tue, 08 Sep 2026 00:00:00 +0700</lastBuildDate>
    <atom:link href="https://nalar.dev/tags/pathlib/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Copy and Move Paths with pathlib in Python 3.14</title>
      <link>https://nalar.dev/copy-and-move-paths-with-pathlib-in-python-3-14/</link>
      <pubDate>Tue, 08 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/copy-and-move-paths-with-pathlib-in-python-3-14/</guid>
      <description>&lt;p&gt;Python 3.14 adds high-level copy and move operations directly to &lt;code&gt;pathlib.Path&lt;/code&gt;. &lt;code&gt;Path.copy()&lt;/code&gt;, &lt;code&gt;Path.copy_into()&lt;/code&gt;, &lt;code&gt;Path.move()&lt;/code&gt;, and &lt;code&gt;Path.move_into()&lt;/code&gt; make many filesystem workflows easier to express without switching between &lt;code&gt;pathlib&lt;/code&gt;, &lt;code&gt;shutil&lt;/code&gt;, and &lt;code&gt;os&lt;/code&gt; for basic operations.&lt;/p&gt;&#xA;&lt;p&gt;The convenience is useful, but filesystem mutations still need explicit policy. Overwrites, symbolic links, metadata, cross-filesystem moves, partial failure, and concurrent changes can all affect correctness.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-four-new-operations&#34;&gt;The four new operations&lt;/h2&gt;&#xA;&lt;p&gt;Use &lt;code&gt;copy()&lt;/code&gt; when the destination path itself is known:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Walk Directory Trees Safely with Python pathlib Path.walk</title>
      <link>https://nalar.dev/walk-directory-trees-with-pathlib-path-walk/</link>
      <pubDate>Tue, 08 Sep 2026 00:00:00 +0700</pubDate>
      <guid>https://nalar.dev/walk-directory-trees-with-pathlib-path-walk/</guid>
      <description>&lt;p&gt;Python 3.12 added &lt;code&gt;pathlib.Path.walk()&lt;/code&gt;, bringing directory-tree traversal directly to &lt;code&gt;Path&lt;/code&gt; objects. It fills the same broad role as &lt;code&gt;os.walk()&lt;/code&gt;, but keeping traversal and path manipulation in &lt;code&gt;pathlib&lt;/code&gt; can make filesystem code easier to read.&lt;/p&gt;&#xA;&lt;p&gt;Walking a tree is deceptively simple, though. Production code needs to decide which subtrees to enter, what to do with unreadable directories, whether symbolic links should be followed, and whether the filesystem may change during traversal.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
