updateFilePathsAndExtensions - Update files in build information with missing paths and file

        extensions - MATLAB ([original](https://in.mathworks.com/help/ecoder/ref/updatefilepathsandextensions.html)) ([raw](?raw))

Main Content

Update files in build information with missing paths and file extensions

Syntax

Description

updateFilePathsAndExtensions([buildinfo](#d126e143934),[extensions](#d126e143953)) specifies the file name extensions (file types) to include in search and update processing.

Using paths from the build information, theupdateFilePathsAndExtensions function checks whether file references in the build information require an updated path or file extension. Use this function to:

If you use updateFilePathsAndExtensions, you call it after you add files to the build information. This approach minimizes the potential performance impact of the required disk I/O.

example

Examples

collapse all

In your working folder, create the folder pathetcproj/etc , add files etc.c,test1.c, and test2.c to the folderetc. For this example, the working folder isw:\work\BuildInfo. From the working folder, update build information myBuildInfo with missing paths or file extensions.

myBuildInfo = RTW.BuildInfo; addSourcePaths(myBuildInfo,fullfile(pwd, ... 'etcproj','/etc'),'test'); addSourceFiles(myBuildInfo,{'etc' 'test1' ... 'test2'},'','test'); before = getSourceFiles(myBuildInfo,true,true);

before

before =

'\etc'    '\test1'    '\test2'

updateFilePathsAndExtensions(myBuildInfo); after = getSourceFiles(myBuildInfo,true,true);

after{:}

ans =

'w:\work\BuildInfo\etcproj\etc\etc.c'

ans =

'w:\work\BuildInfo\etcproj\etc\test1.c'

ans =

'w:\work\BuildInfo\etcproj\etc\test2.c'

Input Arguments

collapse all

RTW.BuildInfo object that contains information for compiling and linking generated code.

The extensions argument specifies the file name extensions (file types) to include in search and update processing. The function checks files and updates paths and extensions based on the order in which you list the extensions in the cell array. For example, if you specify{'.c' '.cpp'} and a folder containsmyfile.c and myfile.cpp, an instance of myfile is updated tomyfile.c.

Example: '.c' '.cpp'

Version History

Introduced in R2006a