bug#60591: `realpath` behaves differently when the target directory/file
From:
Tao Zhou
Subject:
bug#60591: `realpath` behaves differently when the target directory/file does not exist on Mac M1
Date:
Thu, 5 Jan 2023 14:42:59 -0800
Hi I recently noticed something weird with the `realpath` on my Mac Pro M1.
When I try to call `realpath` on a directory/file that does not exist, it
throws `No such file or directory` error, compared to another regular Linux
machine, the `realpath` there will just return a valid path, unless it's a
nested structure and parent does not exist.
Example as:
```
$ pwd
/
$ ls
a
$ realpath b
realpath: b: No such file or directory // from the mac pro M1
/b // from other linux machines
$ realpath b/c
realpath: b/c: No such file or directory // from both mac pro M1 and other
linux machines
```
The `uname -a` of my mac pro M1: `22.2.0 Darwin Kernel Version 22.2.0: Fri
Nov 11 02:03:51 PST 2022; root:xnu-8792.61.2~4/RELEASE_ARM64_T6000 arm64`
Best
Tao