Are there rules that decide if a given program is a virus?

If I maka a simple program that creates a txt file somewhere in system directory (ex. WINDOWS\system32) and via a infinite loop writes text to the file eventualy filling up a hard drive, is that program a virus ?