PHP, 60 30 17 16 1615 bytes
Updated yet again as per @manatwork suggested:
while(!`dir>1``cd>1`); Also now tested.
A bit of cheating 22 bytes:
while(exec('>1 dir'));
Earlier suggestion by @manatwork 30 bytes:
while(file_put_contents(1,1));
NOT TESTED (no php available on this computer) 43 bytes:
for($a=fopen(1,'w');fputs($a,1);fclose($a))
A golfed original 45 bytes:
$a=fopen(1,'w');while(fputs($a,1))rewind($a);
My first post here, joined because I just had to try this out: as long as file write succeeds, rewind file pointer to start.
Just can't get smaller than the file_put_contents().Just can't get smaller than the file_put_contents().