% Humboldt University Berlin
% Institute for Mathematics - Dr. Rene Lamour
% *************************************************************************
% Name:             filprepend.m
%                   ------------
% Author:           Sigrid Wehner
% Stand:            7.7.2003 
%
% Purpose:          inserts text file "filename2" before the beginning of
%                   existing text file "filename1"
%                   result is in "filename1"
% Parameters:       fione - name of first source file
%                           which will contain the result
%                   fitwo - name of second file which will be
%                           inserted before beginning of fione
% ----------------------------------------------------------------------

function [] = filprepend(fione,fitwo)

% open a dummy file to gather fitwo and then fione
fildummy='xxx_dummyfile';
if exist(fildummy) > 0
    delete(fildummy);
end;
filappend(fildummy,fitwo);
filappend(fildummy,fione);

% remark: the following source is necessary because LINUX-matlab does not
% properly perform the "copyfile" command
% (WINDOWS matlab is o.k. with copyfile !)
% -----------------------------------------------------------------------
% delete old fione
delete(fione);

% "rename" fildummy to fione
filappend(fione,fildummy);
delete(fildummy);

