File System

Manage folders and files on target computer


The SimulinkRealTime.fileSystem object provides access to folders and files on the target computer.

The following limitations hold:

  • You can have at most eight files open on the target computer at the same time.

  • The largest single file that you can create on the target computer is 4 GB.

  • A fully qualified folder name can have a maximum of 248 characters, including the drive letter, colon, and backslash.

  • A fully qualified file name can have a maximum of 260 characters: The file part can have at most 12 characters: eight for the file name, one for the period, and at most three for the file extension. A file name longer than eight characters is truncated to six characters followed by '~1'.

  • Do not write data to the private folder on your target computer. It is reserved for Simulink® Real-Time™ internal use.

Object Functions

SimulinkRealTime.fileSystem.cdChange folder on target computer
SimulinkRealTime.fileSystem.dirList contents of folder on target computer
SimulinkRealTime.fileSystem.diskinfoTarget computer drive information
SimulinkRealTime.fileSystem.diskspaceReturn the free space and total space on the drive, in bytes
SimulinkRealTime.fileSystem.fcloseClose target computer file
SimulinkRealTime.fileSystem.fileinfoTarget computer file information
SimulinkRealTime.fileSystem.filetableInformation about open files in target computer file system
SimulinkRealTime.fileSystem.fopenOpen target computer file for reading and writing
SimulinkRealTime.fileSystem.freadRead open target computer file
SimulinkRealTime.fileSystem.fwriteWrite binary data to open target computer file
SimulinkRealTime.fileSystem.getfilesizeSize of file on target computer
SimulinkRealTime.fileSystem.mkdirCreate folder on target computer
SimulinkRealTime.fileSystem.pwdPath to currently active folder on target computer
SimulinkRealTime.fileSystem.removefileRemove file from target computer
SimulinkRealTime.fileSystem.renameRename a file or folder in the target computer disk drive
SimulinkRealTime.fileSystem.rmdirRemove empty folder from target computer
SimulinkRealTime.fileSystem.selectdriveSelect target computer drive


expand all

Create a file system object for the default target computer and use it to list the contents of the current folder

fsys = SimulinkRealTime.fileSystem;
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     

Introduced in R2014a

Was this topic helpful?