Home > vbmeg > external > mne > fiff_end_file.m

fiff_end_file

PURPOSE ^

SYNOPSIS ^

function fiff_end_file(fid)

DESCRIPTION ^

 fiff_end_file(fid)

 Writes the closing tags to a fif file and closes the file

     fid           An open fif file descriptor

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function fiff_end_file(fid)
0002 %
0003 % fiff_end_file(fid)
0004 %
0005 % Writes the closing tags to a fif file and closes the file
0006 %
0007 %     fid           An open fif file descriptor
0008 %
0009 
0010 %
0011 %   Author : Matti Hamalainen, MGH Martinos Center
0012 %   License : BSD 3-clause
0013 %
0014 %   Revision 1.3  2006/04/23 15:29:40  msh
0015 %   Added MGH to the copyright
0016 %
0017 %   Revision 1.2  2006/04/10 23:26:54  msh
0018 %   Added fiff reading routines
0019 %
0020 %   Revision 1.1  2005/12/05 16:01:04  msh
0021 %   Added an initial set of fiff writing routines.
0022 %
0023 
0024 global FIFF;
0025 if isempty(FIFF)
0026     FIFF = fiff_define_constants();
0027 end
0028 
0029 me = 'MNE:fiff_end_file';
0030 
0031 if nargin ~= 1
0032     error(me, 'An open file id required as an argument');
0033 end
0034 
0035 datasize = 0;
0036 count = fwrite(fid, int32(FIFF.FIFF_NOP), 'int32');
0037 if count ~= 1
0038     error(me, 'write failed');
0039 end
0040 count = fwrite(fid, int32(FIFF.FIFFT_VOID), 'int32');
0041 if count ~= 1
0042     error(me, 'write failed');
0043 end
0044 count = fwrite(fid, int32(datasize), 'int32');
0045 if count ~= 1
0046     error(me, 'write failed');
0047 end
0048 count = fwrite(fid, int32(FIFF.FIFFV_NEXT_NONE), 'int32');
0049 if count ~= 1
0050     error(me, 'write failed');
0051 end
0052 fclose(fid);
0053 
0054 return
0055

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005