Current Directory and Parent Directory returned by ListDirectory.
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 4.4k
- 派生
- 993
- 平均合并
- 9 天 21 小时
- 30 天内合并 PR
- 1
描述
Running sftpClient.ListDirectory(path) returns values . and ...
Whilst this is valid behaviour, special consideration has to be given whenever using this command to determine if we want these "relative-folders". There's also no flag (e.g. IsRelative) to easily filter; rather we have to filter on the folder's name to detect / exclude these.
$client.ListDirectory('/files') | Format-Table Name, Is* -AutoSize
Name IsSocket IsSymbolicLink IsRegularFile IsBlockDevice IsDirectory IsCharacterDevice IsNamedPipe
---- -------- -------------- ------------- ------------- ----------- ----------------- -----------
.. False False False False True False False
out False False False False True False False
. False False False False True False False
in False False False False True False False
Adding an option to hide these (either on the call to ListDirectory, or as a preference for the SftpClient itself would be helpful; or simply providing an IsRelative property on the SftpFile class to allow easy discrimination.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 ListDirectory 入口点开始,检查 issue 所示的 SftpFile 表示形式。将请求的过滤选项与 IsRelative 风格的判别器进行比较,然后验证所选行为是否允许调用方在不基于名称进行过滤的情况下排除 . 和 ..。完成的标准是 API 提供一种有文档说明且可测试的方式来隐藏或识别这两个条目。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- networking
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100