I have created a program to download file using ftplib and after editing the file content , I have uploaded to the HP TANDEM SERVER but the file is in ASCII format and it should be reflected as Enscribe file type "U" code 101,but it is reflecting as 180+ coded file, I have used following code to upload a file:
ftp.storbinary('STOR ' + cwd, file)
Asked
Active
Viewed 61 times
-1

Manish Wadile
- 101
- 8
-
We need [mcve]. You didn't even show us what is `cwd` or how is `file` created. The error message you posted in a comment below should be in your question, not there. You have also posted information about command-line `ftp` command that you try to replicate in Python in a [comment to another post](https://stackoverflow.com/q/32283461/850848#comment134601851_32305392). That information is also missing here. No wonder you didn't get any useful answer so far, if you scatter the information this way. – Martin Prikryl May 26 '23 at 07:10
-
@MartinPrikryl as Andy said I appended the ,101 in python ftp.storlines after that I was getting that Error which I have mentioned in comment. that error was not the original problem,the problem is how can I store the file as 101(unstructured Enscribe file) – Manish Wadile May 30 '23 at 09:33
-
How do you store such file in GUI/commandline FTP client? – Martin Prikryl May 30 '23 at 10:17
-
Either we directly create file on Tandem using ssh like ```tedit file_name``` or by put command from windows cmd like ```put source_file_name dest_file_name,101``` – Manish Wadile May 31 '23 at 08:04
-
Ok, that looks trivial then. What problem do you have with implementing this in Python? Once again, show us [mcve] of the code that does not work. – Martin Prikryl Jun 01 '23 at 04:43
1 Answers
1
Append ",101" to the target file name and maybe use storlines rather than storbinary.

Andy Simpson
- 367
- 2
- 6
-
Thanks Andy, I have tried to simulate this command on cmd it is working fine and storing my file as 101 file , but in python when I try it gives me an error ftplib.error_perm: 553 /G/data06/manish/newfile,101: File open error: Invalid function argument , I am using program like this ftp.storlines('STOR ' + cwd + ",101", file) – Manish Wadile May 25 '23 at 04:38