3 ms·
Before I clicked on the article, I pondered the title and thought it would say "make a symlink."
by userbinator 5y ago
Before I clicked on the article, I pondered the title and thought it would say "make a symlink."
- hdjjhhvvhga 5y agoNow we could dig into "What is the fastest way to make a symlink?"
- userbinator 5y agoThe symlink() system call. I can't think of any other way, actually.
- hdjjhhvvhga 5y agoWell, one would start from the symlink libc call, then as you say move on to the system call, then analyze the system call for "redundant" operations (libc calls usually have many, kernel calls much fewer - who needs error checking if all we care is speed?). Then compare it with non-portable raw fs modifications of a chosen filesystem. I bet there could be some tiny gains at each stage.
- LaputanMachine 5y agoIf the file system implements copy-on-write, wouldn't a hard link even preserve the original file if the file is edited through the original inode?
- CyberShadow 5y agoCopy-on-write and hard links are different things. A file clone would, though (as in cp --reflink).
- LaputanMachine 5y agoSo if I understand correctly, copy-on-write is implemented using hard links, but the existence of hard links alone doesn't constitute CoW.
- andruby 5y agoYou can also have hard links on non CoW filesystems (eg ext3). I assume hard links exists on most filesystems