Perl 5, 27 32 22 bytes
{{open my$h,'>o'}redo}
If simply changing the modification timestamp of a file suffices...
Quick explanation:
{ # Braces implicitly create/mark a loop.
{ # New,They morealso localizedcreate scopeclosures, for `my` variablevariables.
open my $filehandle, '>', 'o'; # Writing to file "o".
# close $filehandle; # Called implicitly when
# variable gets destroyed.
} # Scope$filehandle gets destroyed;destroyed sobecause doesthere $filehandleare no references to it.
redo; # ...the loop.
}
Previous solution (32 bytes): {{open my$h,'>o';print$h 1}redo}
Edit: {open F,'O';print F 1;redo} ← Didn't test the code before posting; now I had to correct it.