diff --git a/code/online_plugins/Generic/run_writedataset.m b/code/online_plugins/Generic/run_writedataset.m index c3b4fca7..5bcf1dde 100644 --- a/code/online_plugins/Generic/run_writedataset.m +++ b/code/online_plugins/Generic/run_writedataset.m @@ -43,7 +43,7 @@ function run_writedataset(varargin) % remove superfluous fields eeg = rmfield(stream,{'buffer','smax','buffer_len','timestamps','timestamps_len','timestamps_ptr','streamid'}); stream.timestamp_at_beginning = toc(uint64(0)); -eeg = pop_saveset(eeg,'filename',[fn fe],'filepath',env_translatepath('bcilab:/userdata'),'savemode','twofiles'); +eeg = pop_saveset(eeg,'filename',[fn fe],'filepath',fastif(isempty(fp),env_translatepath('bcilab:/userdata'),fp),'savemode','twofiles'); % re-create the fdt file... delete(fullfile(eeg.filepath, eeg.datfile)); fid = fopen(fullfile(eeg.filepath, eeg.datfile),'wb','ieee-le');