This will empty a file without closing or invalidating any open file handlers so you can empty things like log files without restarting the services that are populating those files.
Right but I don't think anyone is really concerned if it runs in fish. Fish is non standard and doesn't try to adhere to bash. If we want to write fish shell scripts we can do that elsewhere
That works to create an empty file if none exists, but if the file already exists then 'touch' simply updates its atime/mtime and doesn't alter the contents. This latter effect is actually the purpose of touch; the file creation part is just a side effect.