tehmaze-labs / modem

XMODEM, YMODEM and ZMODEM implementations in Python
22 stars 32 forks source link

YModem remote file path / local file path #11

Open ApiumJacob opened 2 years ago

ApiumJacob commented 2 years ago

It may be desirable that the local file path and the remote file path when transmitting a file over ymodem be different. Currently YMODEM.send uses the same file path for both the local and remote filenames. Adding a second parameter to the send function can remedy this issue. If the second parameter is None then the local file will be used for the remote file.

This issue, however, is complicated by the use of glob.glob to expand wild cards in the file name. The use of glob.glob further complicates issues in that it will put directories in to a list that are not expanded to specific files which will probably cause things to fall apart quick quickly.

Should I attempt to add this feature I will assume that only a single file is being transferred per call to send and that it will contain no shell expansion wild cards. Or I will a string that can be prepended to the file to put it in a specific directory on the receiving computer.