Main Content

getFile

Transfer file from SoC board to host computer

Since R2022a

    Description

    getFile(p, source) transfers the specified file from the board to the current MATLAB® folder on the host computer.

    example

    getFile(p, source, destination) transfers the specified file from the board to the location specified on the host computer.

    example

    Examples

    collapse all

    Transfer a file from a specified SoC board to the current MATLAB folder on the host computer.

    Create a Xilinx® processor hardware object and connect to the processor on-board the Xilinx SoC board.​

    p = xilinxsoc('192.168.1.101', 'root', 'root');

    Use the getFile function to transfer a file located in the file path filePath specified with the file name exampleFile.txt to the current MATLAB folder.

    getFile(p, "filePath/exampleFile.txt")

    The file exampleFile.txt is now transferred to your current folder.

    Transfer a file from a specified SoC board to the specified folder on the host computer.

    Create a Xilinx processor hardware object and connect to the processor on-board the Xilinx SoC board.​

    p = xilinxsoc('192.168.1.101', 'root', 'root');

    Use the getFile function to transfer a file located in the file path filePath specified with the file name exampleFile.txt to the Documents folder on your host computer located in the file path C:/User/.

    getFile(p, "filePath/exampleFile.txt", "C:/User/Documents")

    The file exampleFile.txt is now transferred to your Documents folder on your host computer.

    Input Arguments

    collapse all

    Hardware processor object that represents the connection from MATLAB to the processor on a specific SoC hardware board, specified as a xilinxsoc object or intelsoc object.

    Path and name of file on the SoC board that you want to transfer to your host computer. You can use either the absolute path from the root folder, or the relative path from the your home directory.

    Example: "~/exampleFile.txt"

    Example: "/home/user/exampleFile.txt"

    Path of folder or file on the host computer where you want to transfer the file. If destination is the path to a folder, the file is copied inside that folder with the original file name. If destination is the path to a file, the file is copied with the new file name. This function does not create new folders, so folders in the path must already exist.

    If no destination is specified, the current MATLAB folder is used.

    Example: "C:/User/Documents"

    Example: "C:/User/Documents/exampleFileHost.txt"

    Version History

    Introduced in R2022a

    See Also

    Objects

    Functions