Sed insert text at first line of empty file

I can't seem to get sed to allow me to insert text in the first line of an empty file. I have a file.txt that is a 0 byte file. I want sed to insert " fooBar" onto the first line. I've tried a few options and nothing seems to work. They work just fine if there's text in the file tho. Help?

I think sed only works on lines. A zero-byte file has no lines, so that could be the problem.

What are my alternatives? Examples?

Why don't you use echo or is this a homework assignment?

I don't want to use echo because I want the first line to be a comment, and the rest to be values that a script reads from. If the user deletes the commented line like they're not supposed to, i want the script not to fail and to replace the line. I want sed to say:

 sed -i 's/^$/#CUSTOM/' infile

but only to the first line. I don't want #CUSTOM to be all over the place where there's new lines.

my commands go in order: touch infile; sed (add #CUSTOM to beginning of this file). I don't want each iteration of the script to add #CUSTOM to the beginning. ONLY if line one is empty or does not contain #CUSTOM