What happens to the file with colon in the name?

293 Views Asked by At

I'm not a regular curl user, but from time to time I use it to test something.
So I was writing in command line this:

curl -o:output.html www.google.com

It didn't gave me any error, looked like everything is ok, but output file didn't appeared.
So I've started process monitor and checked what is going on, from the screenshot below I think it is clear what was my problem, but now the question - why all three operations are marked as successful? I've searched for filename through whole disk, but there was no file, create file result was Overwritten, so it looks like it actually somewhere was saved. enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

"output.html" is a named stream of the directory (or possibly file) "C:\demo".

Unfortunately the copy command doesn't like stream syntax so you can't use it to copy the data to a regular file. You could use:

notepad c:\demo:output.html

and save the data elsewhere.

Your original problem was getting the curl syntax wrong. It looks like curl doesn't need the colon so it treated it as part of the file name, causing Windows to interpret as a stream name.

You can list named streams with the sysinternals Stream tool.