How to change the file permission?

Hi,
when i create a file in UNIX, i want change the permission file,
I used
Process pgrant = Runtime.getRuntime().exec("chmod 777 "+file.getName());
but i riceive the following error
java.io.IOException: chmod: not found
What can i do?
Regards,
esmeralda13

either call the chmod executable with it's full path, or make sure that the shell your Java app is running in has it's path set correctly.
- K

Similar Messages

  • How to use FilePermission class to change the file permission in Linux

    Hi all,
    I'm running in a issue related to changing the file permission under Linux environment. I'm using Suse 10.0 Linux and run jdk 1.5 java runtime.
    I want to create a file during execution time and change the permission of the same. I use File.createNewFile() API to create file. By default it does not have all the 3 permission (read,write,execute) for all the user ( user,owner,group). Through program I have to change the file permission ( equal to execute ,chmod 777 filename).I donot want to use runtime.exec() with chmod as the argument , since it creates a process to change the permission which may impact the performance. I want to try FilePermission class , by giving filename and permission as the argument. But it is not changing the permission . Could any one faced this problem ?
    If any body guides me, how to change the permission of the file under Linux using FilePermission class , it would be helpful.
    Thanks,
    Sankar

    How do I set the Umask prior to starting the program
    ? Could pls explain in steps.I don't think umask can help you. The mode mask prevents permission bits from being set when a file is created, but does not force any bits to be set. So if execute permission is not set explicitly when a file is created, umask will do nothing about it.
    But if you want more information about umask, see the man page for your shell script (sh, csh, etc.) or "man 2 umask".

  • How to change the file type from IMOVIE PROJECT to other types of file

    how to change the file type from IMOVIE PROJECT to other types of file??
    thank you very much for your help=]

    I am not sure what you mean, but once you make a project. Then go to the share menu and you can export the project to iDVD, itunes, mobileme, quicktime.
    Share export quicktime movie will allow you to export to a variety of codecs. What specific export are you looking to share the movie in? What is the final source that the movie will be displayed?

  • Change the file permission of listener log (log.xml) 11gR2

    Hi
    Is there a way to change the file permission of the listerner log (log.xml)? everytime the a new log.xml is created the file permission is 640.. i want it to be 644. Is there ay configurations that needs to be done?
    DB version is 11gR2.
    Thanks

    peacock wrote:
    Hi
    Is there a way to change the file permission of the listerner log (log.xml)? everytime the a new log.xml is created the file permission is 640.. i want it to be 644. Is there ay configurations that needs to be done?
    DB version is 11gR2.
    Thanks
           umask [-p] [-S] [mode]
                  The  user  file-creation mask is set to mode.  If mode begins with a digit, it is interpreted as an octal
                  number; otherwise it is interpreted as a symbolic mode mask similar to that  accepted  by  chmod(1).   If
                  mode  is  omitted, the current value of the mask is printed.  The -S option causes the mask to be printed
                  in symbolic form; the default output is an octal number.  If the -p option is supplied, and mode is omit-
                  ted,  the  output  is in a form that may be reused as input.  The return status is 0 if the mode was suc-
                  cessfully changed or if no mode argument was supplied, and false otherwise.

  • How to change the file name of pdf file in html page?

    Hi,
    Actually my requirement is to upload 50 PDF files containing javascript in each file into flex page with the help of one html page.
    i did the the javascript part by using batch processing.
    now i want to call those pdf files one after another without changing the file name in html page
    the code written in html page is
    <html>
        <body>
            <object id="PDFObj"
                    data="http:\\localhost\pdf\20090807 - Batch 630.pdf"
                    type="application/pdf"
                    width="100%"
                    height="100%">
            </object>
            </body>
    </html>
    So every time i have to change that file name to acess another file.
    Is there is any other way to sort this problem????
    Plz anyone help me to sort out this problem with some code or some example.

    I once had a similar task for creating a webpage that I only use on my computer--a webpage that accesses PDF's and SWF's font previews from a list of fonts as "a href's".  What you must do is utilize the power of the command line, whether on a Mac on a PC or on Linux, Linux being the most powerful (although Mac IS Unix).  You must utilize variables, variable replacement, and then a command to print out the results of a "for" or "while" loop to a text file which will be your HTML file with each individual link automatically built into the HTML code.  You will have a list of 50 links.  If you are simply looking for a GOOGLE type functionality where you click on "Next" and "Previous" you will have to dig deeper into variable replacement--this I don't know how to do yet but there are books for command-line shell interpreters.  One shell interpreter is called "bash" (born-again shell) and there is a book on the market which gives a detailed example of how to replace variables in a shell script.  Again, I don't know how it works.  I will try to learn this at a later time when I am more seasoned with the basics of shell scripting.

  • How to change the file main.html in catalyst?

    My Web Hosting can not accept files with main.html, only with index.html. How to rename the file in Catalyst? Please do not tell me I have to go to the builder to do this.
    here is the link: http://www.insight-gd.com  and see what comes up.
    thx
    Mike

    chris, I'm in open war with the people from my server hehehe, they say that it is possible to accept the domain main.html. But my question is if I return the letter M by m, will not interfere in other files?
    thx
    Mike

  • How to change the file pointer in random access file?

    I have a file, now I want to add a line at both the beginning and ending of the file. Should I use random access in this case? How can I move the pointer to the end of the file in that case? Thanks!
    ruuram

    I have a file, now I want to add a line at both the
    beginning and ending of the file. Should I use random
    access in this case?That's up to you. RandomAccessFile doesn't allow you to insert data at the beginning of the file, though.
    How can I move the pointer to the
    end of the file in that case? Thanks!
    file.seek(file.length())

  • What is the command to change the file permission of all the files in a directory recursively?

    I know it is chmod -R <permission> Files/directory_name in unix/linux. Tried the same format but not getting the desired output.
    Any suggestion about the format of command in Solaris ?
    chmod <permission> filename is working but not chmod -R <permission> directory_name doesn't.
    Thanks
    Shashank.

    This command is correct. What is the result of the command if you run it ? What is the command that you use ? And which file system format is it ?

  • How to change the file format

    I have an Issue.
    When I create an Outbound Delivery in VL01 my file path is getting update.
    But it is updating in format of Idoc Message Type "WHSORD" and Basic Type "Delivery03".
    Now I want to change my format from Idoc type to my Custom format.
    Do you have any suggestion where I need to do my Enhancement or to Implement and BADI.
    Thanks in Advance.
    Thanks & Regards
    Nickel

    I have an Issue.
    When I create an Outbound Delivery in VL01 my file path is getting update.
    But it is updating in format of Idoc Message Type "WHSORD" and Basic Type "Delivery03".
    Now I want to change my format from Idoc type to my Custom format.
    Do you have any suggestion where I need to do my Enhancement or to Implement and BADI.
    Thanks in Advance.
    Thanks & Regards
    Nickel

  • Changing the file name of a PDF you send via email

    Hello Support,
    I am trying to find out how to change the file name of the attachment I send via email when I click submit via email. I would like the file to be sent with the file name, not some other file name.
    How can I fix it? This is very urgent! I need HELP!
    Cheers
    Joel
    Message was edited by: J Braden

    Hi,
    you can't.
    Except you save the file under a different name before you send it.

  • Changing the file format

    hi guys,
    i hv a requirnment in which i need to read a file which is in .CGL format on a shared network path or application server which is nt possible to read directly so i need to first change the format of the file to .CSV and then read it using the FM KCD_CSV_FILE_TO_INTERN_CONVERT .
    so plz  tel me how to change the file extension
    thanks
    shivraj

    Not quite sure how you arrived at conclusion that CGL must be converted to CSV... CGL might turn out to be just a plain text file (e.g. many log files have .LOG extension but are just plain texts), in which case you can simply read it directly. Whether you'll be able to make sense of the file data - is another question and it depends on what is in that CGL file. Again, conversion to CSV might not even help.
    If CGL file is a proprietary format, you might not be able to read it in SAP at all without using some third-party tool.
    More info on CGL extension:
    http://pcsupport.about.com/od/fileextensions/f/cglfile.htm

  • Change the file set icons system wide

    Hello,
    I am trying to change all my .html, .js, .css file sets, system wide. Right now they are all the plain boring white with text. If I go into a folder they quickly appear with their more colorful Dreamweaver, photoshop, etc icon, but quickly jump back to the plain white, boring icon. I know how to change the files icons one by one, but obviously that could take a while.
    Looking for an easy way to change my files system wide wothout screwing anything up. Recently came from a PC and loving my mac (never going back).
    Thanks in advance!

    Hi
    Still no :o)
    The only way around it, is to wrap your conc process that generates the etext output either with another program or if its an Oracle Report based program, in the after report trigger. That will get a handle on the generated file, easy enough cos you'll know the requestid, and then copy and rename it to the same or another location. We used to do this for a payments process in the Netherlands localization we ship.
    Tim

  • Changing Folder & File Permission via Java Program

    Please help me with some Java Code on how to change Folder & File Permission on CM

    Hi Christopher,
    Perhaps this
    Repository Service auto change resource permissions
    thread might help you.
    Regards,
    Patrick.

  • HT1941 I have inadvertently changed a file permission setting. When opening Aperture I get the following; Aperture cannot access this library. To use this library make sure it's file permissions are set correctly. I am an old dude new to Mac OS. What up?

    I have inadvertently changed a file permission setting. When opening Aperture I get the following; "Aperture cannot access this library. To use this library make sure it's file permissions are set correctly". I am an old dude new to Mac OS. Looked in settings but have no idea how to allow file sharing to myself. I have been using Aperture actively for 6 weeks. I'm the only one using this Mac. What up?

    Back up all data now.
    This procedure will unlock all your user files (not system files) and reset their ownership and access-control lists to the default. If you've set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. If none of this is meaningful to you, you don't need to worry about it.
    Step 1
    If you have more than one user account, and the one in question is not an administrator account, then temporarily promote it to administrator status in the Users & Groups preference pane. You can demote it back to standard status when this step has been completed.
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Drag or copy — do not type — the following line into the Terminal window, then press return:
    sudo chflags -R nouchg,nouappnd ~ $TMPDIR.. ; sudo chown -R $UID:20 ~ $_ ; chmod -R -N ~ $_ 2> /dev/null
    Be sure to select the whole line by triple-clicking anywhere in it. You'll be prompted for your login password, which won't be displayed when you type it. You may get a one-time warning not to screw up. You don't need to post the warning. If you don’t have a login password, you’ll need to set one before you can run the command.
    The command will take a noticeable amount of time to run. Wait for a new line ending in a dollar sign (“$”) to appear, then quit Terminal.
    Step 2
    Boot into Recovery by holding down the key combination command-R at startup. Release the keys when you see a gray screen with a spinning dial.
    When the OS X Utilities screen appears, select Utilities ▹ Terminal from the menu bar. A text window opens.
    In the Terminal window, type this:
    resetpassword
    That's one word with no spaces. Then press return. A Reset Password window opens. You’re not going to reset a password.
    Select your boot volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select  ▹ Restart from the menu bar.

  • How to change the default "Safe" files in Safari?

    I would really appreciate if anybody could teach me how to change the default "Safe" files using AppleScripts, Folder Actions or .plist files. I really would like to have some files to open automatically after download, specially .pps files, and safari doesn't recognize such files as "safe". I tried to find out reading the help files but got lost.
    I posted a reply in an old topic for somebody who seemed to know, but it was not related to that topic, so I decided to open a new one.
    I'll be gratefull for any help. Thanks.

    Hi MDRC,
    Have a read of [this topic|http://discussions.apple.com/thread.jspa?threadID=1237961] to see if that helps.

Maybe you are looking for

  • Image shrinks when I pull it into my claim application

    Hi, I've created some forms in Acrobat 8.1 prof., that are to be read by a state's OCR reader, but when i load it to my claim application, the image shrinks and the form fields are no longer in the position I need them to be in. is there a way to con

  • ACE SSL Sticky class-map generic vs class default differences.

    There was a thread recently titled "ACE 3.0(0) SW / LB with SSL Session-ID" where Giles Dufour outlined a configuration for an ACE performing sticky based on SSL Session ID. Can anyone explain the benefits and differences of using a specific class-ma

  • Create Substitute Users in SAP ECC 6.0

    Dear Gurus, Can someone guide on how to create a temporary user Substitute User) in SAP ECC 6.0. This is a user who will only use the SAP system for a short period while the substantive user is away on leave such that the system should lock the subst

  • Weird Behavior. Why does Safari do this?

    Please, can someone explain to me why Safari (1.3.2) hops tabs? I click a link in one tab and instead of going forward to that link, replacing this tab's contents, it jumps (not all the time but usually) to a different open tab and replaces what was

  • Using Ipod Touch to create documents?

    Hi, I was considering purchasing the Ipod Touch to use as a PDA. I would like to know if I can use it to create word documents, or any word processing utility to type basically with double spaced format and such. Thanks.