Why does curl allow use of the file URL scheme, but not wget

一笑奈何 提交于 2019-12-12 10:36:17

问题


This question refers to curl 7.21.4 and GNU Wget 1.13.4, I don't know if the answer is version specific.

Using the file URI scheme I can get local file using curl as such

$ curl file://localhost/Users/dave/.vimrc
contents of .vimrc

However if I try the same using wget I receive an error:

$ wget file://localhost/Users/dave/.vimrc
file://localhost/Users/dave/.vimrc: Unsupported scheme `file'

Does anyone know why this is the case?


回答1:


Because Wget has not been written to support file:// URLs. (It's front web page clearly states "GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP")

Allow me to point to a little curl vs wget comparison.




回答2:


wget only supports the HTTP, HTTPS, and FTP protocols.



来源:https://stackoverflow.com/questions/10440976/why-does-curl-allow-use-of-the-file-url-scheme-but-not-wget

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!