I tried to open a file in a Zorro script using this code:

// -----------------------------------
#include <stdio.h>
bool schalter1 = false;
bool schalter2 = false;
FILE *pf;

function run()
{
if (!schalter1)
{
schalter1 = true;
pf = fopen("D:\Zorro\Log\test.txt","w");
}

var *Price = series(price());
var *Trend = series(LowPass(Price,1000));
var *Signals = series(0);

Stop = 4*ATR(100);
if (year(0) == 2013 && !schalter2)
{
msg("%f",pf);
schalter2 = true;
fprintf("Hallo",pf);
fclose(pf);
}
}
// -----------------------------------------

But it does not work as 0 is assigned to pf which means there was an error while opening the file.
Can someone help me with that?