为什么curl允许使用文件URL方案,而不是wget [英] Why does curl allow use of the file URL scheme, but not wget

查看:178
本文介绍了为什么curl允许使用文件URL方案,而不是wget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是指curl 7.21.4和GNU Wget 1.13.4,我不知道答案是否具体版本。

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

使用文件URI方案我可以使用 curl 获取本地文件

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

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

然而,如果我尝试使用 wget 错误:

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?

推荐答案

因为Wget尚未编写为支持file:// URL。 (这是前面的网页清楚地说GNU Wget是一个免费软件包用于检索文件使用HTTP,HTTPS和FTP)

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")

请允许我指出一点 curl vs wget comparison

这篇关于为什么curl允许使用文件URL方案,而不是wget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆