Deleting a file named 'nul'
Posted on 2004-08-23
Here is the problem, a script I have written output its errors to 'nul'
ie. ls > nul
This is pdksh with a cygwin base for unix commands.
Where the big problem exists is that the script creates a file in the running dir called 'nul'. Windows can not have a file named nul nor can you delete a 'nul' file.... pdksh, bask, csh, dos, windows xp, winpe, all cannot delete the file. I have even tried using rar and other comprestion programs to add the file to an archive and delete the file after making archive, and yet again, the file is still there.
Using cat I can see the contents of the file, but so far that is the only command that can see the file, noptead and all windows based programs error on 'nul' files.
If anyone has a way to delete this file that would be great.