Current Directory and Parent Directory returned by ListDirectory.
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 993
- Avg merge
- 9d 21h
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the ListDirectory entry point and inspect the SftpFile representation shown by the issue. Compare the requested filtering option with an IsRelative-style discriminator, then verify that the chosen behavior lets callers exclude . and .. without name-based filtering. Done means the API exposes a documented, testable way to hide or identify both entries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100