I'm recently working on a file agent that will be deployed on machine of both linux and windows to perform unified file transfer. It generally consist of a sshd server and a vfs manager. Usually one agent would use the vfs manager to connect to the sftp server on another agent and manipulate file on it.
The obstacle I just encountered is that windows file system is different with linux's for it typically has multiple roots(drives). Although the root path of ssh can be configured using the FileSystemFactory
, it can't be changed at runtime and therefore making it impossible to access other drives after server bootstrap.
When using vfs to connect to the sftp subsystem of another agent, as expected it can only resolve the file in the drive where its root path resides. But, WinSCP seems not restricted by this and can change both current directory and drive when connected.
I wonder whether it is possible to construct a virtual FileObject
corresponding to the /
of linux file system, and access different drive like they're folders under that root. Or is there other ways to acquire the FileObject
on other drives?