converting fid from MATLAB fopen() to Unix fd suitable for Unix read

조회 수: 8 (최근 30일)
Barry
Barry 2011년 10월 24일
댓글: Edouard Delaire 2025년 10월 6일 21:34
MATLAB's fopen() returns an integer fid for which MATLAB freads() and fwrites() can be made. But this fid integer is not a fd as returned from the UNIX open() system command (that is it cannot be used with the UNIX read() system command). Is there any way to get access to the underly UNIX fd associated with the MATLAB fid so that I can use it with the UNIX read() system routine?
This is a general question. The specific use I have in mind is to be able to read part of a binary file that contains long double (128 bit floats) into MATLAB. I figured I'd just have a short Mex file do the system read() and conversion into a double Mex MATLAB array. The reason I don't want to use the UNIX open() system command to open the file is I am already using MATLAB fread() to read in many other items from the binary file and don't want to rewrite all of that in C.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by