File alloc difference between NT and 95?

Can anyone help me with the following problem?
I have created a program which merges a couple of files into one
big chunck. The funny thing is that it does work on WinNT, but doesn't
work on Win95...

I have recompiled my sources with delphi2 on win95, but that doesn't
change anything either.. Delphi does not give any errors either.
The problem is that it seems to merge all files into one file as it is
supposed to do, and when i check the filesize with for example Explorer
it shows the correct filesize. BUT if I view that file with edit, qedit,
notepad, whatever it is truncated to the header, and while viewing the
filesize again it now is only 1kb instead of the full size..
this only happens on Win95.. WinNT does the job perfectly.
How come? is there are an internal file management difference which
enables this?

This is what I do:
I show a listbox with files, the user clicks on the files he wants
to be merged, enters an output name and presses the 'build' button.
I get the selected filenames, the output name and then:
1. proc CreateHeader
2. proc CreateStamp
3. proc MergeFiles              {this is just an append of files)

The createheader works fine, it just writes out an .ini file as it is
supposed to do.
The CreateStamp however doesn't work right, it is supposed to place
a $90 char at the eof file, so I can easily extract the files later.
The mergefiles doesn't work either, but this probably has the same
error as createStamp..
The CreateStamp doesn't show the $90 at all.. The funny thing is that
if I only execute the CreateStamp (withouth CreateHeader) it does
work correctly..
I have tried a zillions things, and it seems that CreateStamp sometimes
(mostly) just dumps chars from memory ..randomly.. hugh?

Please help me out if you can..

tim cohen

I have included the necesarry source below:

procedure createHeader;
var   lus : byte;
      f : file;
      selectfound: byte;

  {delete existing output file}
  If FileExists(getcurrentDir+'\'+form1.edit1.text+'.raw') then

  {create raw file}
  RAWIni := TIniFile.Create(getcurrentDir+'\'+form1.edit1.text+'.raw');
  {write total number of files}
  RAWIni.WriteInteger('Files', 'Total files', SelectedFiles);

for selectfound:= 1 to selectedfiles do
 {write filenames}
 RAWIni.WriteString('Include', 'Name'+IntToStr(selectfound),
IncludeFile[selectfound]);  {array which keeps track of included files
                              needed later}
 {write filesize}
 RAWIni.WriteInteger('Size', 'Name'+IntToStr(selectfound), size);

Procedure CreateStamp;
var RAWfile: file;
    Stamp_bytes:array[1..1] of byte;
    FromF, ToF: file;
    NumRead, NumWritten: Integer;
    Buf: array[1..2048] of Char;
    x : byte; {loop variabele}
if FileExists(form1.edit1.text+'.raw') then
  {copy header file to a temp.raw, but don't close or it is impossible
   to append that damn $90 !}
   AssignFile(FromF, form1.edit1.text+'.raw');
   Reset(FromF, 1);     { Record size = 1 }
   AssignFile(ToF, 'temp.raw'); { Open output file }
   Rewrite(ToF, 1);     { Record size = 1 }
    BlockRead(FromF, Buf, SizeOf(Buf), NumRead);
    BlockWrite(ToF, Buf, NumRead, NumWritten);
   until (NumRead = 0) or (NumWritten <> NumRead);
   Erase(FromF);  {erase source file. Later on the tempfile will be
                   renamed to the source file}

   if not RenameFile('temp.raw', GetcurrentDir+    
'\'+form1.edit1.text+'.raw') then Msg('file not Found!');
else FileNotFound; {The header .RAW file doesn't exist}