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".

Similar Messages

  • 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 use application class reference in the controller methods of BSP

    Hi,
    I have created a bsp application and also created an application class and assigned it to the application class. In the application class, I have created attribute TEXT type string(public and instance parameter).
    In the controller let's say main.do, I am trying to give a value to to the text by adding the following code.
    application->text = 'test'.
    I am getting syntax error saying field 'text' is unknown. It is not contained in one of the specified tables nor defined by DATA statement. 
    Please can someone let me know how to use the application class in the coding with an example. I couldn't find how exactly this has to be reference. Please help.
    Best regards
    Siva

    Hi,
    if you are having main controller and sub-controller then you may need to use below coding to use application class reference.
    *Data declaration
      DATA:  obj_cntrl        TYPE REF TO cl_bsp_controller2,
             obj_sub_cntrl   TYPE REF TO z_cl_sub_cntl,
             application TYPE REF TO z_cl_application.
    *Get the controller
      CALL METHOD obj_main_cntrl->get_controller   "obj_main_cntrl is the object of main controller
        EXPORTING
          controller_id       = 'SUB'   "Controller ID
        RECEIVING
          controller_instance = obj_cntrl  .
      obj_sub_cntrl ?= obj_cntrl  .
      application ?= obj_sub_cntrl ->application.
    or simply use below code in your controller method.
      application ?= me->application.
    Thnaks,
    Chandra

  • How To Use Logic Express To Change The Speaking Voice

    I'm new to Logic. I've been messing around with it for awhile. I can't seem to find what I'm looking for.
    I'm looking for a filter, or a way to setup a filter that will automatically change the speaking voice (for podcasts etc.). I want the voice to sound realistic to the end user, yet sound significantly different then the original voice file.
    What's the fastest, easiest way to do this in Logic (or some other software)?
    Thanks

    No, these plugins I mentioned are included in Logic.
    On the channel strip for the track click on an empty "Inserts" slot. From the drop down menu you can choose from a variety of Effects plugins.
    As you are new to Logic, you might get some benefit from following this blog & specifically these beginners guide articles I've written:
    http://www.macprovideo.com/blog/logic-pro/complete-beginners-guide-apple-logic-9 -part-1
    http://www.macprovideo.com/blog/logic-pro/complete-beginners-guide-apple-logic-9 -part-2
    and the Logic 101 video tutorial at macProVideo.com
    Cheers
    R

  • 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

  • Using date class to change the alpha of an object depending on time (GMT)

    Hi,
    I'm trying (and struggling) to get my head around AS3 and am building a flash webpage. I have 2 layers in the timeline, each containing a movie clip matching the page size with instance names backgroundDay and backgroundNight.
    What I'm wanting is for the background to change for the day and night, so that from 18:00 to 06:00 the alpha of backgroundDay becomes 0 to show backgroundNight behind.
    I'm been scouring the internet and haven't found anything so if anyone can help it'd be much appreciated. 
    Many thanks,
    Sophie

    Yes, you could use a timer. Something like this:
    var t:Timer = new Timer(1000);
    t.addEventListener(TimerEvent.TIMER, timerHandler);
    t.start();
    function timerHandler(event:TimerEvent)
    var d:Date = new Date();
    backgroundDay.alpha = (d.hoursUTC > 5 && d.hoursUTC < 18) ? 1 : 0;

  • 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 ?

  • My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file loca

    My computer is saying it can't find the file 'iTunes64.msi' when I try to update or redownload iTunes how do I fix this? I've tried just about everything I can think of. I am using a dell laptop running windows 7 and have tried changing the file location to run the update in all of my iTunes files as well as when I've tried reinstalling it.

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    The further information area has direct links to the current and recent builds in case you have problems downloading, need to revert to an older version or want to try the iTunes for Windows (64-bit - for older video cards) release as a workaround for installation or performance issues, or compatibility with QuickTime or third party software.
    Your library should be unaffected by these steps but there are also links to backup and recovery advice should it be needed.
    tt2

  • How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.

    How can I change (or select) what is being being used when I share, as the file cover. When I Share lets say "Master File" i want to select a frame that is used as the file cover. So when its on my desktop I see this image as the file icon.

    I don't think Finder does this (I've tried).
    iTunes does though. Where you can set artwork or the "poster frame"...
    This may not be what you want but if it helps, I know 2 ways  do this is
    Open the video in QuicktimePlayer7 | View | Set Poster Frame (even then, you might need to save it as .mov (ie in a 'mov container').
    Drag the file into iTunes and set the artwork (as in http://www.dummies.com/how-to/content/adding-album-cover-art-or-images-in-itunes .html)
    From there, iTunes will use that frame as the "poster frame" ie the photo/frame that shows when you browse your videos. Which is what you want, but limited to iTunes.
    When I do either of these above, the frame I set does not show when exploring files in "Finder" (or in the other Explorer tool I use called "Pathfinder").
    So it maybe, that exactly what you want, is not possible.

  • Pse 7 changes the file extensions, by using a -1 up to 6 times on a photo, how to stop this problem.

    I cannot keep up with my photos, they somehow change the file extension by adding
    a -1 over and over, how can I stop this process
    to keep a single file extension?

    I checked out the backup/sync, it is not turned on after checking.   Also I do not have a second computer as a backup, I use an Esata drive of 1 TB.
    I have a photo called Rose.jpg, later I try to open the file and it tell be its lost.  I try to reconnect, no luck, then I manually try to find the file and its called Rose-1.jpg or up to Rose-1-1-1-1-1-1.jpg or Rose-1-1-1-1-1-1_edited.jpg.  I do not understand what is taking place in my computer with my photos.   I have about 17,000 photos and I am having a real problem.
    Any help would be appreciated.  sghmotorhome

  • A guest at our home used his ipad and changed the network name. How do I change it back to the apple network

    A guest at our house was using his ipad and changed the apple netwrok name to another and put a password on it.  How do I eliminate this netwrok and get back to the Apple Network?

    Please check out the following AirPort User Tip for details on resetting the password. Once that is done, you can access the base station to change its Wireless Name (or SSID) back to what you prefer. To discourage other "guests" from changing the AirPort settings, you should also change the default base station Administrator password.

  • How can I change the file download time using Adobe Send? Adobe SendNow had a lot more options.

    How can I change the file download time using Adobe Send? Adobe SendNow had a lot more options.I don't see nay with Adobe Send.

    There isn't a feature in Adobe Send for setting and end-date for a file's availability. At any time, you can Unshare the file, however.

  • How Does EJB 2.0 Specification Change the BC4J?

    Hi,
    I had read the while paper of BC4J thoroughly. The following statement interested me:
    "As Oracle9iAS, WebLogic, and other J2EE application server vendors begin to rollout complete support for the new EJB 2.0 specification in the first half of 2002, a new release of the BC4J framework will be released which includes support for the new local entity beans. This work entails enhancing our lightweight, local entity classes to support the necessary interface to be lightweight EJB 2.0 Local Entity Beans. ...."
    I have searched all the documents about BC4J, but I couldn't find anything more about "How Does EJB 2.0 Specification Change the BC4J?"
    I think the "Local EJB Entity Beans" is similar with BC4J DAO. So is there someone who can tell me how does EJB 2.0 Specification change the BC4J?
    Any help would be appreciated!
    James

    We support using local CMP entity beans as your persistence layer for your entity objects, but as it adds an extra layer, it's turned out (in all honesty) to not be that popular a feature.
    The performance offered by the simpler BC4J entity object (plain old java class) is fine, and the notion of using simple java beans for your model is widely recognized as a fine option for J2EE applications.
    For example, check out Rod Johnson's book called "Expert one-to-one: J2EE Design and Development" which covers this subject excellently.

  • I recently had some 8mm film transferred to DVD. I am trying to edit the film clips using Premier Elements 4.0.  Some of the film clips copy into the project but others don't. I tried copying the VOB filed onto my hard drive and then changing the file ext

    I recently had some 8mm film transferred to DVD. I am trying to edit the film clips using Premier Elements 4.0. so I can reburn the films on a single BluRay disc. Some of the film clips copy into the project but others don't. I tried copying the VOB filed onto my hard drive and then changing the file extensions on the VOB files to MPEG but this was no help. Some of the VOB files contain numerous film clips but my software does not appear to be able to recognize them as such. I need to know if replacing my old Premier Elements with the new Version 13 would solve this problem or not. Any advice would be greatly appreciated!
    Bob

    Bob
    What do you have now.....
    What computer operating system do you have?
    We can go into the finer points of source and your intentions, but for now it would appear that you are using SD 4:3 source media to get to a HD 16:9 result. Lots to discuss in this regard.
    What was given to you on the DVD disc? DVD-VIDEO 4:3 or something else?
    If DVD-VIDEO on DVD disc, you should expect to find on the disc a folder named VIDEO_TS. That is your target for your video files.
    If you were given a DVD-VIDEO on DVD disc, then all you want from it are the video files, specifically
    VTS_01_1.VOB, VTS_01_2.VOB, and so on through that series until possibly getting to
    VTS_02_1.VOB, and so on. How many files you have beyond the VTS_01_1.VOB file will depend on the size of the DVD-VIDEO.
    Does the above scenario apply to you?
    The alternative might be someone giving a DVD disc (data disc) which contains just the VTS files mentioned which were copied from
    the VIDEO_TS Folder. So, you do not get the whole VIDEO_TS Folder, just the essential video files. Does this scenario apply to you.
    I see no need to replace your Premiere Elements 4 with a later version unless you have a huge project and need a later version that will be a 64 bit application running specifically on Windows 7, 8, or 8.1 64 bit computer.
    Consider...Premiere Elements 4 and if you have DVD-VIDEO on DVD....
    1. Place the DVD disc in the burner tray
    2. Open Premiere Elements 4 and set the project preset for NTSC DV Standard (assuming you are working in a NTSC setup)
    3. Go to
    Get Media
    "DVD, Digital Camera, Mobile Phone, Hard Drive Camcorder, Card Reader"
    "Adobe Premiere Elements - Media Downloader" and its Advanced dialog.
    Set the Source in the latter dialog for the drive which has your DVD disc inserted in its tray
    You should see your VTS_01_1.VOB thumbnail in the "Adobe Premiere Elements - Media Downloader" Advanced dialog.
    With this VOB selected, click on Get Media to get the file from there into the project.
    Should work fine.
    Complications may be involved if the people who processed your footage gave you something other what is described above.
    Please review and consider, and then we can plan our project strategy accordingly.
    Thank you.
    ATR

  • How do I stop GoLive from changing the location of my CSScriptLib.js file?

    How do I stop GoLive from changing the location of my CSScriptLib.js file?
    I am making rollovers and want my CSScriptLib.js to be in the same folder as my HTML files.
    Every time I edit the rollovers GoLIve recreates the path of the CSScriptLib.js to file:///Users/xxx/Library/Preferences/Adobe/GoLive/Settings8/JScripts/GlobalScripts/CSScr iptLib.js so it won't work when uploaded. I always need to edit my HTML before uploading. All I want it to say is src="CSScriptLib.js" as the default.

    The site file is a database that keeps track of all your assets (and much more), including the scriptLib file. As soon as the page is saved (when you use the site file and it's open) the link will be change to the correct path that will work on the server.
    If you're not using the site file you might as well use a text editor, since most of GL functionality is gone.

Maybe you are looking for

  • How to design a Wizard Screen

    Hi All, I want to design a wizard screen ( Like  MRP wizard , Registration Wizard). In screen1 i have From date, To date the department details, schedule details and in the screen2 it has the workcenter details. In screen1 after entering the details

  • Preview & Navigator issues

    I'm running LR 3 on Model Name: iMac   OSX 10.6.4   Model Identifier: iMac8,1   Processor Name: Intel Core 2 Duo   Processor Speed: 2.8 GHz   Number Of Processors: 1   Total Number Of Cores: 2   L2 Cache: 6 MB   Memory: 2 GB   Bus Speed: 1.07 GHz 1. 

  • Dial a phone number in contacts with a prefix adde...

    I would like to automatically add a prefix of 4 digits to the phone number when I make an IDD call. Can someone advise how to configure N95 to have this feature. Thanks!

  • MMC cannot open the file msisa.msc

    Hi, I've been dealing with this problema for a few hours and been searching all over to find no solution to it. I have installed a TMG 2010 SP2 server on a Windows Server 2008 R2 SP1 Server. The installation goes OK, I'm installing first the EMS serv

  • Mail Proxy: Emails got stuck in Outgoing directory

    Hi We have a BM3.9SP1 on NW6.5SP7 configured as a HTTP Proxy, Transparent Proxy and inbound Mail Proxy. But we have a lot of email stucked in the Outgoing Directory(7000 files) and I don't know why. The BM has only one network card defined asa public