zoukankan      html  css  js  c++  java
  • Hadoop学习之fileSystem.delete方法

    fileSystem.delete里边主要有两个参数一个Path,这个是要删除的路径Path f,一个是是否递归(recursive)
    Path f, boolean recursive

    /** Delete a file.
    *
    * @param f the path to delete.
    * @param recursive if path is a directory and set to
    * true, the directory is deleted else throws an exception. In
    * case of a file the recursive can be set to either true or false.
    * @return true if delete is successful else false.
    * @throws IOException
    */
    源码里是这样写的 ,我的理解是

    如果要删除的路径是一个文件,参数recursive 是true还是false都行
    如果要删除的路径是一个目录,参数recursive 开启true就是递归删除,如果填false,而下级目录还有文件,就会报错
    关于递归或者递归删除可以自行百度。

  • 相关阅读:
    MvvmTest
    win8 app 相关的几个网站
    autp
    分析WPF代码工具
    mdsn
    线程和委托
    C#guanli
    学习Boost小结(一)
    Boost.test库的配置
    自己真是太没正事了.
  • 原文地址:https://www.cnblogs.com/igong/p/11959320.html
Copyright © 2011-2022 走看看