-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Kernel API /api/file/readDir
support for returning symbolic link information
#8805
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
Conversation
Your PR was set to target |
"name": entry.Name(), | ||
"isDir": entry.IsDir(), | ||
"name": entry.Name(), | ||
"isDir": info.IsDir(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"isDir": info.IsDir(), | |
"isDir": entry.IsDir(), |
Why change from entry.IsDir()
to info.IsDir()
?
entry.IsDir()
/ dir.IsDir()
(where entry
and dir
are of type fs.DirEntry
) is being used in kernel/util/file.go > IsDirRegularOrSymlink
too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// entry is a symlink to a dir
path := filepath.Join(dirPath, entry.Name())
info, err = os.Stat(path)
entry.IsDir() // return false
info.IsDir() // return true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, I missed the changes in file.go later, Zuoqiu has extracted a function IsSymlink()
, it seems to be no problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Zuoqiu-Yingyi Thanks for the explanation, I get it, merge first.
@fenilgmehta If there is something we missed, please continue to add comments, thank you.
/api/file/readDir
support for returning symbolic link information/api/file/readDir
support for returning symbolic link information
isDir: true, isSymlink: true
isDir: true, isSymlink: false
isDir: false, isSymlink: true
isDir: false, isSymlink: false