DocumentationHelp Center
List folder contents on device
dir(device,folder)
clist = dir(device,folder)
example
dir(device,folder) lists the files in a folder on the ROS device. Wildcards are supported.
device
folder
clist = dir(device,folder) stores the list of files as a structure.
clist
collapse all
Connect to a ROS device and list the contents of a folder.
Connect to a ROS device. Specify the device address, user name, and password of your ROS device.
d = rosdevice('192.168.17.129','user','password');
Get the folder list of a Catkin workspace on your ROS device. View the folder as a table.
flist = dir(d,'/home/user/Documents/mw_catkin_ws/'); ftable = struct2table(flist)
ftable=6×4 table name folder isdir bytes _____________________ _____________________________________ _____ _____ {'.' } {'/home/user/Documents/mw_catkin_ws'} true 0 {'..' } {'/home/user/Documents/mw_catkin_ws'} true 0 {'.catkin_workspace'} {'/home/user/Documents/mw_catkin_ws'} false 98 {'build' } {'/home/user/Documents/mw_catkin_ws'} true 0 {'devel' } {'/home/user/Documents/mw_catkin_ws'} true 0 {'src' } {'/home/user/Documents/mw_catkin_ws'} true 0
rosdevice
ROS device, specified as a rosdevice object.
Name of the folder to list the contents of, specified as a character vector.
Contents list, returned as a structure. The structure contains these fields:
name — File name (char)
name
char
folder — Absolute path (char)
bytes — Size of the file in bytes (double)
bytes
double
isdir — Indicator of whether name is a folder (logical)
isdir
logical
deleteFile | getFile | openShell | putFile | rosdevice | system
deleteFile
getFile
openShell
putFile
system
A modified version of this example exists on your system. Do you want to open this version instead?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office