Information about open files in target computer file system



open_file_table = filetable(filesys_object) returns a table of the open files in the target computer file system.

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


Use the filetable function only to recover the lost file handle value when MATLAB® exits with files still open on the target computer. The function has no other use.

Note: The SimulinkRealTime.fileSystem object will be removed in a future release. See the release note for file system commands to use instead. These commands use the SimulinkRealTime.openFTP function and the functions for the MATLAB ftp object.


collapse all

Open a file, get the table containing its file handle, and close it.

Open a file.

tg = slrt;
filesys_object = SimulinkRealTime.fileSystem(tg);
file_id = fopen(filesys_object, 'data.dat', 'r');

Get the file handle of the file.

ans =

  1×186 char array

Index    Handle  Flags     FilePos  Name


    0  03DF0000  R__             0  C:\data.dat

Close the file.

fclose(filesys_object, hex2dec('03DF0000'))
ans =


Input Arguments

collapse all

File system object created by using the SimulinkRealTime.fileSystem creation function.

The file system object represents the target computer file system. You work with the target computer file system from the development computer by using file system methods.

Example: fsys

Data Types: struct

Output Arguments

collapse all

The file table includes the full file name, the file handle in hexadecimal, and technical information for use by a maintenance technician.

Introduced in R2014a