-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbolic Links to directories are treated as files by file.GetFiles #28
Comments
This should be a simple fix. I'll look in to it. |
That should just require changing list_directory. Is it worth counting DT_DIR and DT_LNK (symlinks) as directories, DT_REG as files, and ignoring any named pipes, etc. that are in a directory? That seems strictly more correct. |
@Ozymandias117 that what I thought. I just hadn't gotten around to looking at it. |
@Ozymandias117 so the deal here is that if we count DT_LNK, we need to make sure it's a symlink to a directory. We also need to make sure to follow recursive symlinks. I'm sitting here looking at |
Yeah, we need to figure out what type of symlink it is and add it in either case, if it's a file or a directory. Are you saying opendir doesn't follow symlinks in the path? I'm not sure where we really need to care about recursive symlinks, otherwise? We only enumerate the directories and files given a directory, right? |
@Ozymandias117 |
My point was that it looks like lapi::getdir looks like it only ever cares about one directory at a time. If that's the case, and opendir successfully deals with symlinks, I don't think we have to do any recursion or deal with it? We just need to properly list a single directory given a path. There's nothing that looks through directories recursively in the BLT stuff, is there? I can look more closely when I'm at a real computer tomorrow night, if I need to. |
@Ozymandias117 I think you may be missing the point. The original issue here was that |
My confusion was at "I think that if we split off 'is this a directory' in to a separate tail-recursive function that we could easily do it" I wasn't clear why we need to recurse over anything to tell if a symlink is a directory. I'll leave it to you, do what you think is best. |
@Ozymandias117 ah, that was just me trying to avoid |
@GreatBigBushyBeard please test the issue_28 branch and see if it fixes your problem. |
The symbolic links with file.GetDirectories appear to be fixed now, just tested the file.GetFiles and it isn't showing the symbolic linked directories anymore either. Looking good. |
Sounds good. |
Also means that they do not show up when using file.GetDirectories, but show up under file.GetFiles.
I'm creating my symbolic links through
ln -s
The text was updated successfully, but these errors were encountered: