<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"><channel><title>MagicLen</title><link>https://magiclen.org/tag/path-absolutize/</link><description>多元化原創文章，內容包羅萬象，有程式語言、網站應用、軟體介紹、硬體介紹、作業系統、旅行遊記、專題採訪、益智問題、文學創作，以及作者們的知識分享和作品分享。</description><language>zh-TW</language><lastBuildDate>Tue, 1 Dec 2026 07:32:36 +0800</lastBuildDate><atom:link href="https://magiclen.org/tag/path-absolutize/feed/" rel="self" type="application/rss+xml"/><sy:updatePeriod>hourly</sy:updatePeriod><sy:updateFrequency>8</sy:updateFrequency><sy:updateBase>1970-01-01T00:00+00:00</sy:updateBase><item><title>Rust 程式語言如何取得檔案的絕對完整路徑？</title><link>https://magiclen.org/path-absolutize/</link><description><![CDATA[<img src="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png" srcset="https://magiclen.org/wp-content/uploads/2018/04/rust-220x162.png 1x, https://magiclen.org/wp-content/uploads/2018/04/rust-440x324.png 2x, https://magiclen.org/wp-content/uploads/2018/04/rust-660x486.png 3x" alt>
在大部分的情況下，我們不會限制使用者輸入檔案路徑的時候一定要使用絕對路徑還是相對路徑。但是在程式處理的過程中，或是需要輸出一些 Log 資訊的時候，我們可能就必須要將路徑通通都使用絕對路徑來處理了。Rust 程式語言標準函式庫中的「fs」模組，以及「Path」和「PathBuf」結構體，雖然有提供「canonicalize」函數或方法，是可以取得檔案的絕對路徑沒錯，但使用起來有一些嚴重的限制。]]></description><category>Rust</category><category>Rust</category><category>path-absolutize</category><guid>https://magiclen.org/path-absolutize</guid><pubDate>Mon, 24 Sep 2018 20:00:21 +0800</pubDate><dc:creator>Magic Len</dc:creator></item></channel></rss>