Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Barry
Barry le 24 Oct 2011
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.

Réponses (0)

Catégories

En savoir plus sur Low-Level File I/O dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by