5 ms·
Yeah, it's another one of the many things that the Windows kernel gets right but *nix programmers never care to give it credit for. `FILE_LINK_INFORMATION` in W
by wfunction 10y ago
Yeah, it's another one of the many things that the Windows kernel gets right but *nix programmers never care to give it credit for. `FILE_LINK_INFORMATION` in Windows has a `ReplaceIfExists` flag just for this purpose.
- rincebrain 10y agoI'm not sure which is wrong, the person writing or the documentation, but rename() claims to be atomic with few exceptions even when overwriting an existing item.[1] The only reason I suspect things do unlink-then-rename is that (evidently) rename() doesn't promise anything about what happens to the "src" item if rename() fails, just that something will still be in "dest".[1] But I don't know why the commands do something different, and don't want to try reading the source of either GNU or BSD mv to find out why. [1] - http://pubs.opengroup.org/onlinepubs/009695399/functions/rename.html http://pubs.opengroup.org/onlinepubs/009695399/functions/ren...
- pif 10y agoIt's funny how you name Windows kernel in a comment about symbolic links, considering that it _misses_ symbolic links.
- ordinary 10y agohttps://en.wikipedia.org/wiki/NTFS_symbolic_link https://en.wikipedia.org/wiki/NTFS_symbolic_link
- geocar 10y agoThese things are called symbolic links, but are not what UNIX calls a symbolic link. The name is unfortunate and perhaps cannot be helped.
- icebraining 10y agoWhat's the difference? Because MS claims it has created them "to function just like UNIX links", and I'm not seeing how they're wrong.
- geocar 10y agoOn UNIX, anyone can create a symbolic link, and a symbolic link can contain arbitrary text, while Windows requires admin privileges and that the target be a valid file path. The new WSL does have symbolic links, but these are only available to Linux programs.
- icebraining 10y agoThe admin privileges is just the default security policy, you can configure it to allow regular users.
- geocar 10y agoThat is really bad advice. An application should not change the default security policy.
- icebraining 10y agoI'm not saying it should. I'm saying it's not a property of the symlink feature. Some Linux distro could implement the same policy, but symlinks would still be symlinks.
- lisivka 10y agoNo, it cannot be disabled via a policy in Linux, because it is regular FS operation, not a filter.
- icebraining 10y agoSure it could, SELinux policies can operate on regular FS operations just fine.
- CyberShadow 10y agoIt goes much further than that: https://en.wikipedia.org/wiki/Transactional_NTFS https://en.wikipedia.org/wiki/Transactional_NTFS
- marcosdumay 10y agoYou know, that fixes the "May not be available for your operating system variant." disclaimer. All the other still apply, and the GP forgot to tell you to check your HD model's documentation.
- AnonymousPlanet 10y agoIt is one thing to get it right from a disgn perspective, but another to get it right from an implementation and common usage perspective (see the sibling threads to this comment). If it doesn't exist in practice or does something different in a thousand edge cases, it's rightfully dismissed as nonexistant.