0001 function fiff_end_file(fid)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
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