![]() ![]() To carry out the opposite operation it is sufficient to use the same command with different parameter cd / home / PETRIS / zipTemp ajar -x /home/PETRIS/myZipFile.zipĪt this point the system will have extracted the contents of myZipFile.Introduction to IFS(Integrated File System) on IBM i AS400 RMVDIR DIR ('/ home / PETRIS / zipTemp') unzip * & MYFLATFLD = field of the MYFLATFILE * / physical fileĬHGVAR VAR (& QSHCMD) VALUE ('cd myFolderIFS ajar -cM /home/PETRIS/myZipFile.zip' * CAT & MYFLATFLD)ĬHGVAR VAR (& QSHCMD) VALUE ('cd myFolderIFS ajar -aM /home/PETRIS/myZipFile.zip' * CAT & MYFLATFLD)Įvery time the operating system inserts a file into the zip it disappears from the IFS (in practice the file is moved from the folder to the archive)Īt this point all that remains is to delete the files and the temporary folder DLTF FILE (QTEMP / SRC)ĭEL OBJLNK ('/ home / PETRIS / zipTemp / listaFilesDaZippare.txt') ![]() MONMSG MSGID (CPF0000) EXEC (GOTO CMDLBL (FINECICLO)) Copy from source file to physical file (previously created)ĬPYF FROMFILE (QTEMP / SRC) TOFILE (QTEMP / MYFLATFILE) MBROPT (* REPLACE) FMTOPT (* CVTSRC) ERRLVL (* NOMAX)Īt this point we proceed to create the zip file (only the first time) and insert each of the files in the list CHGVAR VAR (& NVOLTE) VALUE (1) ![]() Once the list of files is obtained, in order to manage a reading cycle we copy the text into a physical file // Creating source filesĬRTSRCPF FILE (QTEMP / SRC) RCDLEN (212) MBR (* FILE)ĬPYFRMSTMF FROMSTMF ('/ home / PETRIS / zipTemp / elencoFilesDaZippare.txt') TOMBR ('/ QSYS.LIB / QTEMP.LIB / SRC.FILE / SRC.MBR') MBROPT ( * REPLACE) ENDLINFMT (* LF) QSH CMD (& QSHCMD) Creating and populating zip files *> /Home/PETRIS/zipTemp/listaFilesDaZippare.txt') In order to get the list of files contained in an IFS folder it is possible to launch the ls comma nd CHGVAR VAR (& QSHCMD) VALUE ('cd myFolderIFS ls *. First of all it is better to create a workbook inside t he / tmp (present by default on all releases) or inside one’s home (ex. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |