V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
lixia625
V2EX  ›  Linux

wget -N 这样的操作是怎么实现的?

  •  
  •   lixia625 · 2014-08-28 22:07:02 +08:00 · 3071 次点击
    这是一个创建于 3545 天前的主题,其中的信息可能已经有所发展或是发生改变。
    其实我想问的就是,所谓文件是不是最新的,是基于什么判断的?文件完全一样就是最新?
    3 条回复    2014-08-29 13:46:29 +08:00
    mind3x
        1
    mind3x  
       2014-08-28 22:17:40 +08:00   ❤️ 1
    看RFC,送HEAD请求,再根据各种和最近修改时间有关的header来判断 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
    WKPlus
        2
    WKPlus  
       2014-08-28 23:12:18 +08:00   ❤️ 1
    "When running Wget with -N, with or without -r or -p, the decision as to whether or not to download a newer copy of a file depends on the local and remote timestamp and size of the file. -nc may not be specified at the same time as -N."
    man里面的解释是根据timestamp和size.
    lixia625
        3
    lixia625  
    OP
       2014-08-29 13:46:29 +08:00
    @WKPlus 话说时间戳又是怎么一回事,任何网页都有的?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   914 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 20:26 · PVG 04:26 · LAX 13:26 · JFK 16:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.