GNU bug report logs - #60591
`realpath` behaves differently when the target directory/file does not exist on Mac M1

Previous Next

Package: coreutils;

Reported by: Tao Zhou <iamzhoutao92 <at> gmail.com>

Date: Fri, 6 Jan 2023 05:24:02 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tao Zhou <iamzhoutao92 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: `realpath` behaves differently when the target directory/file does
 not exist on Mac M1
Date: Thu, 5 Jan 2023 14:42:59 -0800
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 133 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.