| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → xPC Target |
| Contents | Index |
| Learn more about xPC Target |
MATLAB command line
dir(file_obj)
file_obj | Name of the xpctarget.ftp or xpctarget.fs object. |
Method of xpctarget.fsbase, xpctarget.ftp, and xpctarget.fs objects. From the host PC, lists the contents of the current folder on the target PC.
To get the results in an M-by-1 structure, use a syntax like ans=dir(file_obj). This syntax returns a structure like the following:
ans = 1x5 struct array with fields: name date time bytes isdir
where
name — Name of an object in the folder, shown as a cell array. The name, stored in the first element of the cell array, can have up to eight characters. The three-character file extension is stored in the second element of the cell array.
date — Date of the last save of that object
time — Time of the last save of that object
bytes — Size in bytes of that object
isdir — Logical value indicating that the object is (1) or is not (0) a folder
List the contents of the current folder for the file system object fsys. You can also list the contents of the current folder for the FTP object f.
dir(fsys) or dir(f)
4/12/1998 20:00 222390 IO SYS
11/2/2003 13:54 6 MSDOS SYS
11/5/1998 20:01 93880 COMMAND COM
11/2/2003 13:54 <DIR> 0 TEMP
11/2/2003 14:00 33 AUTOEXEC BAT
11/2/2003 14:00 512 BOOTSECT DOS
18/2/2003 16:33 4512 SC1SIGNA DAT
18/2/2003 16:17 <DIR> 0 FOUND 000
29/3/2003 19:19 8512 DATA DAT
28/3/2003 16:41 8512 DATADATA DAT
28/3/2003 16:29 4512 SC4INTEG DAT
1/4/2003 9:28 201326592 PAGEFILE SYS
11/2/2003 14:13 <DIR> 0 WINNT
4/5/2001 13:05 214432 NTLDR '
4/5/2001 13:05 34468 NTDETECT COM
11/2/2003 14:15 <DIR> 0 DRIVERS
22/1/2001 11:42 217 BOOT INI'
28/3/2003 16:41 8512 A DAT
29/3/2003 19:19 2512 SC3SIGNA DAT
11/2/2003 14:25 <DIR> 0 INETPUB
11/2/2003 14:28 0 CONFIG SYS
29/3/2003 19:10 2512 SC3INTEG DAT
1/4/2003 18:05 2512 SC1GAIN DAT
11/2/2003 17:26 <DIR> 0 UTILIT~1 You must use the dir(f) syntax to list the contents of the folder.
xPC Target file object methods mkdir, cd, and pwd.
MATLAB dir function.
![]() | delete | diskinfo | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |