dir
List folder contents on device
Description
Examples
View Folder Contents on ROS Device
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
Input Arguments
device
— ROS or ROS 2 device
rosdevice
object | ros2device
object
ROS or ROS 2 device, specified as a rosdevice
or ros2device
object, respectively.
folder
— Folder name
character vector
Name of the folder to list the contents of, specified as a character vector.
Output Arguments
clist
— Contents list
structure
Contents list, returned as a structure. The structure contains these fields:
name
— File name (char
)folder
— Absolute path (char
)bytes
— Size of the file in bytes (double
)isdir
— Indicator of whethername
is a folder (logical
)
Version History
Introduced in R2019b
See Also
rosdevice
| ros2device
| putFile
| getFile
| deleteFile
| openShell
| system
MATLAB Command
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.
Select a Web Site
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
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)