Bo Anderson added the comment:
> You don't even need a C program to reproduce
Indeed, touch is built upon the POSIX file API (unless Apple modified it). The
idea for the Apple bug report was to show it happening at a low level and not
specific to a given tool.
> And the "cd
Bo Anderson added the comment:
Indeed. The issue can be trivially reproduced with:
```
#include
#include
#include
#include
int main()
{
char buf[255];
printf("Current dir: %s\n", getcwd(buf, 255));
int fd = open("../../tmp/test.txt", O_WRONLY | O_
Bo Anderson added the comment:
For what it's worth, this is having an impact on some real code:
https://github.com/Homebrew/homebrew-core/pull/45110
Perhaps a simpler way to reproduce is:
% cd /tmp
% python3 -c 'import os; open(os.path.relpath("/tmp/test.txt"), "w&