i want to execute chmod in java code ,how?

Posted on 2005-04-12
Last Modified: 2010-08-05
i want to execute chmod in java code how?,in the entree i have parameter for umask
so i must convert them into chmod parameter ,then executing chmod
thank u for ur help
Question by:laes_
    LVL 35

    Accepted Solution

    Runtime.getRuntime().exec( "/bin/chmod " + mask + " " + filename ) ;

    should do it...
    LVL 35

    Expert Comment

    >>  i have parameter for umask so i must convert them into chmod parameter

    You can just do:

    chmod 755 filename

    no need to generate parameters...
    LVL 86

    Expert Comment

    >>in the entree i have parameter for umask

    Can you say a little more about this and the relation to chmod? umask is used to set initial perms on a newly created file

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
    Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now