Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftp command tries to fetch full path #9

Closed
Taywee opened this issue Jan 5, 2017 · 3 comments
Closed

ftp command tries to fetch full path #9

Taywee opened this issue Jan 5, 2017 · 3 comments

Comments

@Taywee
Copy link
Collaborator

Taywee commented Jan 5, 2017

When using ftp -get with an absolute path, the command fetches from an absolute path to an absolute path, rather than to the local directory (which is more expected behavior with FTP). This is very likely not desired. (for instance, if I use ftp -get /tmp/testfile.txt, it fetches it from the system's /tmp/testfile.txt to the local machine's /tmp/testfile.txt, regardless of the current working directory. This won't work if you're trying to fetch a file by absolute path to a directory that doesn't exist on the local machine. I just ran into this issue with trying to fetch /QIBM/qzrdhasm/qzrdhasm.log from an as400 machine)

@jwoehr
Copy link
Owner

jwoehr commented Jan 5, 2017

The ftp command is broken in a couple of ways in that it is partly broken in JTOpen itself. But I think if you use the -to localfilepath dashcommand or -tofile ~@{localfilepath} it will work.

@Taywee
Copy link
Collaborator Author

Taywee commented Jan 5, 2017

-tofile would probably work. I didn't see that one. I think I tried -to and it just redirected the text output of the command (eg. the "226 File transfer completed successfully." text). As -tofile covers it, I'll close this issue. It's not the ideal default behavior, but it shouldn't cause too many problems, as most interactive use will probably use relative paths (or just an FTP program) and most scripted use should use -tofile anyway.

@Taywee Taywee closed this as completed Jan 5, 2017
@jwoehr
Copy link
Owner

jwoehr commented Jan 5, 2017

The -tofile and -to dichotomy arises from the fact that -to interprets a tuple as a the user wanting the output in a tuple. It interprets different forms as different types of datasinks. -tofile means "any way I provide the arg, I mean a file". The way I coded FTP (shudder) is that if -to points to a file datasink, the output file is set to that. Other than that, -to redirects the text output of the command. Ugh. Try -tofile and see if it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants