Yes, the exact same way as a symlink to an existing file. For obvious reasons you can only create a soft link as a hard link requires an inode (which won't exist because the file doesn't exist).Does anyone know if this is possible and if so, how?
dice@pibsd:~/test % ln -s /some/nonexistant/file myfile
dice@pibsd:~/test % ls -al
total 8
drwxr-xr-x 2 dice dice 512 Nov 5 11:03 .
drwxr-xr-x 7 dice dice 512 Nov 5 11:01 ..
lrwxr-xr-x 1 dice dice 22 Nov 5 11:03 myfile -> /some/nonexistant/file
Yes, the exact same way as a symlink to an existing file. For obvious reasons you can only create a soft link as a hard link requires an inode (which won't exist because the file doesn't exist).
Code:dice@pibsd:~/test % ln -s /some/nonexistant/file myfile dice@pibsd:~/test % ls -al total 8 drwxr-xr-x 2 dice dice 512 Nov 5 11:03 . drwxr-xr-x 7 dice dice 512 Nov 5 11:01 .. lrwxr-xr-x 1 dice dice 22 Nov 5 11:03 myfile -> /some/nonexistant/file