<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">> Catch that error, and copy-and-delete.<div class=""><br class=""></div><div class="">I suggest this is typical EAFP (Easier to ask for forgiveness than permission) coding style from Zen of Python</div><div class=""><a href="http://docs.python.org//glossary.html#term-eafp" class="">http://docs.python.org//glossary.html#term-eafp</a></div><div class=""><br class=""></div><div class="">I'm very curious to know how Haskellers think and do about it?</div><div class=""><br class=""></div><div class="">Is there something close to Zen of Haskell?</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 2021-04-15, at 13:08, Donn Cave <<a href="mailto:donn@avvanta.com" class="">donn@avvanta.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><blockquote type="cite" class=""><blockquote type="cite" class="">I don't know how to detect whether two filepaths are in the same <br class="">filesystem.<br class=""></blockquote></blockquote><br class="">Yes you do!<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">If I use System.Directory.renameFile and the final location is in <br class="">another filesystem, I'll get an error "renameFile:renamePath:rename: <br class="">unsupported operation (Invalid cross-device link)".<br class=""></blockquote></blockquote><br class="">And it follows that if you get no error, the two filepaths are in the<br class="">same filesystem<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class="">What's the best way to move the file if possible but copy-and-delete <br class="">if necessary?<br class=""></blockquote></blockquote><br class="">Catch that error, and copy-and-delete.<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">   </span>Donn<br class="">_______________________________________________<br class="">Haskell-Cafe mailing list<br class="">To (un)subscribe, modify options or view archives go to:<br class=""><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" class="">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br class="">Only members subscribed via the mailman list are allowed to post.</div></div></blockquote></div><br class=""></div></body></html>