Closed TrySound closed 5 years ago
It's been a while since I bashed my head on the windows fs, but as I recall, the safe thing to do is use hard links (fs.link
) everywhere, which should work for gobble. Windows supports sorta symlinks, but I think they require a special permission granted to the user that isn't there by default.
I believe windows and posix hard links behave the same way, so if they work ok on one, they should work on the other.
Should we prevent using symlinks or warn when they are used in Windows. In the second case I need some help from *nix users to write tests.
Are you referring to symlinks in the source? I think it's perfectly valid to hard link a symlink, at least in posix land. A quick test suggests that it is, anyways.
@evs-chris I mean something like this. Do you mean they are the same thing here?
Ah yes. In the case that the source has a symlink to a dir, everything should be copied for the reasons mentioned in the comment. But if the symlink is a file, it can probably be safely hard linked in the new target folder. I'd say that finding symlinks in source would probably be fairly rare, and I think that node just has issues creating symlinks on windows. So as long as gobble doesn't try to create a symlink, it should be good. To be clear, hard linking a symlink does not appear to be the same as creating a symlink, since the symlink is more or less a file that can itself be hard linked.
Does that help any? Sorry, I've not had much free time for gobble in the last year or so, so I'm pretty far out of touch with the code.
/cc @gobblejs/core I need some help to test symlink which doesn't work in windows.