fix: use SFTP readdir for file listing to support MikroTik and non-Linux systems #495
Reference in New Issue
Block a user
Delete Branch "fix/mikrotik-file-manager"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
readdiras primary method for listing filesls -lawhen SFTP is unavailableRoot Cause
MikroTik devices run RouterOS, which doesn't have standard Linux commands like
ls. The file manager was usingls -laexclusively, causing failures on non-Linux systems.Changes
modeToPermissions()helper to convert POSIX mode to permission stringformatMtime()helper to format Unix timestamps like ls -la output/ssh/file_manager/ssh/listFilesto use trySFTP + tryFallbackMethod patternreadlink()is used to resolve symlink targetsData Format Notes
Test plan
Fixes Termix-SSH/Support#317