简体   繁体   中英

Moving files from root directory in AS400

I have a script which moves and renames files from an AS400 directory to a Windows directory on a separate server. The successful process moves data from a folder created in a library on the AS400. For technical reasons the AS400 developer moved the source data to the root on the AS400.

Now that I have modified the script to point to the different source I get an error "Invalid procedure call or argument". My question is can we move data from the AS400 root or does it have to reside within a library? I can still move files from within the library but not from the root. Any advice? Thanks!

If I'm reading your comment (and your previous question ) correctly, you need to be able to move a file with the ability to overwrite. One way to do that is by copying and deleting. CopyFile will overwrite a file by default.

fso.CopyFile strFromFile, strToPath
fso.DeleteFile strFromFile

See the following MSDN pages for CopyFile and DeleteFile for additional details.

If the root is "/" then this is not a library and you are having a flat file similar to what it will be on the Windows box. You will most likely not be able to use your existing toolkits for this, but perhaps CPYSTRF or similar? Can you just ftp it in from the Windows box?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM