I'm writing a Python program centered around transferring files from a PC to a target device.
So far I've used the ftplib package for all the other functions in the program.
I've encountered a problem that didn't happen in any of the other devices so far, that the ftp.pwd()
returns just an empty string, but when I use the ftp.voidcmd("PWD")
- which is the same as ftp.pwd()
I get my working directory.
Here is the snippet that relates to the problem, note the I have done the same with a few other devices and it never happened:
# CONNECT TO TARGET
ftp = FTP (host)
ftp.login(username , password)
ftp.cwd("/DirName")
# DOESNT WORK
res = ftp.pwd()
print(res)
# WORKS
res = ftp.voidcmd("PWD")
print(res)