This question is actually derived from a problem I have with a python library which deletes a file tree and then recreates the content, but on attempt of execution of a file inside the directory, the compiler throws no such file or directory
error, and I was able to recreate the same situation on *nix systems as such with shell itself.
Shell 1 >
mkdir test
cd test
touch a.txt b.txt
Shell 2 >
rm -rf ~/test
mkdir test
cd test
touch c.txt
Shell 1 >
ls
At this instance, ls
command on the first shell wont return anything, even though c.txt exists at that particular path.
On reading of some random resources on internet, I stumbled across stat
command, and I executed it on both shells to check if theres an inode difference and it seems like there is, but I am not sure how can I get to the newly created folder from the first shell without cd
-ing to it. I am hoping that I can replicate the same process on python.
Thanks in advance for the solutions and ideas.