Is it possible to zip a list of files over ftp?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Thomas Kurian
el 9 de Mzo. de 2023
Respondida: Thomas Kurian
el 10 de Mayo de 2023
Hello
I have a camera saving a series of images on a remote computer that I would like to download. I am currently using ftpobj and mget running in a loop to get all the files which is quite time consuming. I was wondering if it is possible to zip the files remotely through matlab and just use mget for the .zip file
2 comentarios
Stephen23
el 9 de Mzo. de 2023
Editada: Stephen23
el 9 de Mzo. de 2023
"I was wondering if it is possible to zip the files remotely through matlab and just use mget for the .zip file"
For this to make any sense, the zipping would need to be performed by some application at the remote end (otherwise zipping using a local application would still require transferrring all file uncompressed data remote->local->zip locally... not much sense in that). So you would have to get MATLAB to request a remote application to perform the zip, before using FTP to transfer that zip file. You have not told us what OS or applications are available at the remote end.
Note that "FTP" stands for "File Transfer Protocol", and it has no provision for calling arbitrary applications at the remote end:
Respuesta aceptada
Más respuestas (2)
Sarvesh Kale
el 9 de Mzo. de 2023
See if the following documentation helps, zip function matlab document . mget function in matlab. Example code usage is shown below
% assume that your folder has jpeg images you want to compress
% on remote computer
zip('backup',{'*.jpeg','*.jpg'}) % compress all files which are jpeg or jpg format to backup.zip
execute the below code on your local machine
% on local machine
s = ftp('your host address'); % enter your host ftp address in place of 'your host address' in single commas
mget(s,'backup.zip') ;
I hope the above helps in your query.
Thank you.
4 comentarios
Stephen23
el 9 de Mzo. de 2023
Editada: Stephen23
el 9 de Mzo. de 2023
"but I guess the answer to the question is that it is not possible entirely in Matlab"
This is not a MATLAB problem, but a conceptual problem. Zipping requires the CPU to process the data. MATLAB is running on your local CPU. So to use your local MATLAB to zip the data, you would need to transfer all of the data to your local computer, where your local CPU is, which can then locally zip the data. A local app running on a local CPU cannot suddenly jump through space and run on a remote CPU, to process some data there.
It has nothing to do with MATLAB, it applies to all applications.
Ver también
Categorías
Más información sobre FTP File Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!