Manage Raspberry Pi Files
Use the getFile, putFile, and
deleteFile functions to manage files on your Raspberry Pi® hardware.
The getFile function downloads files from the
Raspberry Pi hardware. The putFile function uploads files to the
Raspberry Pi hardware. The deleteFile function deletes files on the
Raspberry Pi hardware. All of these functions:
Use SCP and SSH protocols, which provide encrypted communications.
Use the current folder in MATLAB® as the default file location in on the host computer.
Use the present working directory (pwd) as the default file location on the Raspberry Pi hardware.
Accept absolute or relative paths to specify nondefault file locations.
Let you specify the destination file name.
Note
Certain Linux® functions are limited in MATLAB Online™. See Security Considerations for Raspberry Pi in MATLAB Online for details.
To download a file from the Raspberry Pi hardware to your host computer, use the getFile function. Use
the second argument to specify the path and name of the file.
system(mypi,'ls') getFile(mypi,'/home/pi/.profile')
By default, getFile saves the file to the current folder in MATLAB. You can use a third argument to specify a download folder on your host
computer.
getFile(mypi,'/home/pi/.profile','C:\Users\myusername\Desktop')
putFile
function.putFile(mypi,'C:\Users\myusername\Desktop\.profile','/home/pi/')
If you use the Camera Board to record video, download the video file. Then, delete the file from the Raspberry Pi hardware.
getFile(mypi,'myvideo.h264','C:\MATLAB') deletFile(mypi,'myvideo.h264')