Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to create and delete the directory in HDFS?

  • //To create a new directory
    Sample Code Segment

    Path path= new Path("user/D/filelLocation/");fs.mkdirs(path);

    Command

    hadoop fs -mkdir <path>

  • //To delete the directory
    Sample Code Segment

    FileSystem fs = FileSystem.get(conf);fs.delete(new Path(“path”,true)) //delete file

    Command

    hadoop fs -rm -r <hadoop path>