2 ms·
copy nul %1 >nul to get an empty file. It's not a replacement for touch, though, as touch will do something different to existing files. Your attempt will sile
by ygra 10y ago
copy nul %1 >nul
to get an empty file. It's not a replacement for touch, though, as touch will do something different to existing files. Your attempt will silently overwrite the file in that case.
- jeeva 10y agoCouldn't you just append null to a given filepath to get the same result, or am I misguidedly assuming that >> creates files that don't exist?
- ygra 10y agoInteresting idea, but type nul >> file doesn't change the metadata, perhaps because nothing was written. But yes, it would at least not destroy files.