How to set permissions to a file ?

hi,
i have a requirement to set file permissions and also to get the current permission mode on the file. PLease let me know if there are any inbuilt functions to set permissions to a file. (eg: CHMOD in unix) .
canRead() and canWrite() are only to get the permission. what about methods to set the permission for a file ? If there are no methods whats the possible way...
Thanks,
Sarat

May be I am not sure but try this
Runtime.getRuntime().exec("EXecute chmod command here");

Similar Messages

  • How to set permissions on a file for a Mac without active Directory

    We don't have our Macs in the Active Directory, we are looking to share an external hard drive to only Macs and not the Windows PC's on the network with out using active directory. I have tested sharing the external hard drive from a PC to everyone and both the PC's and Macs can access this, but we only want the Macs to see this and access this and not everyone. There is no selection for sharing with the computer name in the Share permissions so the only way to do this is to share it to everyone. The Mac accounts are local to the Macs and the PC's are on Active Directory so what i need to do is have a way to share this folder with only Macs and not all the windows PC's. Any solutions, any ideas will help
    Thanks

    hi
    good
    go through these links
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b9/b4de3f68d48f15e10000000a155106/content.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/be/0de03f41b9eb06e10000000a1550b0/content.htm
    thanks
    mrutyun

  • How to set up a basic file sharing server for my small architectural business?

    I have no idea if I have posted in the correct area as this is my first forum post within the apple support community!
    I have been using a 21.5" imac running 10.6.8 for the past 5 years to run my small home based architectural design business. I have been using the internal hard drive & backing up the necessary data to a simple usb external hard drive. I am now looking to firstly purchase a new imac 27" retina and purchase new autocad lt 2015 for mac software. I am looking to have another imac (my old mac) running in conjunction with the new mac. I want both macs to be able to access the same data and am slightly unsure what is the best way to achieve this.....As my old mac is currently only running snow leopard and an old version of autocad for mac 2011 it wont run on any more recent OS. Essentially i believe I have 2 main options with this.... (1) I Accept that I have to purchase 2 no. autocad lt 2015 licences @ a cost of £2300. Or option (2), I only run autocad on the new mac as this will be the primary station and the old mac used for primarily for admin & accounts. I have also recently discovered that it is possible to rent autocad licences for £300p/a which may also be another option (3)!
    I previously had a problem where my hard drive failed on my mac & lost all data on the internal hard drive, luckily I had been backing up all data regularly to my external hard drive and now loss occurred! Obviously with any new system I want to ensure that my data is safe!
    I currently utilise about 250GB of data for business operations but this will obviously grow with time.
    In the future I would like to have the option of potentially being able to access the network data remotely via macbook pro whilst abroad although at this stage this really isnt my primary objective. Although I believe I could achieve this through apple remote desktop.
    I suppose I should provide some information with regard to the required speed of the system...I regularly open 50-100 photos at the same time totalling around 250-500MB. I would like the system to be able to handle this fairly easily.
    I have been trawling through forums and to be honest they are totally confusing me. I have also spent time on the phone to the apple business team and have also discussed my objectives with a member of the apple team in store.
    There have been various options advised to me and I really do not know which is the most appropriate route forward.
    1 - Using a mac mini as the file server and linking the 2 mac devices to this and backing up the mac mini to an external hard drive to ensure no loss of data.
    2 - Using a time capsule as a file server and linking the 2 mac devices to this and backing up the TC to an external hard drive to ensure no loss of data.
    3 - Using the new mac hard drive and linking the 2 macs via thunderbolt (old mac does not have thunderbolt and so I guess I would need another new mac?!) and then backing up the data to a time capsule.
    4 - Using a RAID based server and linking the 2 no. macs.
    Sorry to ramble but any advice really would be greatly received!

    Hi sblemings,
    Welcome to the community.
    I think with your scenario you should ask yourself, how complicated do you want the setup to be and how much time would you have to be able to resolve an issue should one occur with this setup.
    All the options that have been advised would work but they come with complexity and therefore time.
    1 - Using a mac mini as the file server and linking the 2 mac devices to this and backing up the mac mini to an external hard drive to ensure no loss of data.
    2 - Using a time capsule as a file server and linking the 2 mac devices to this and backing up the TC to an external hard drive to ensure no loss of data.
    3 - Using the new mac hard drive and linking the 2 macs via thunderbolt (old mac does not have thunderbolt and so I guess I would need another new mac?!) and then backing up the data to a time capsule.
    4 - Using a RAID based server and linking the 2 no. macs.
    Sorry to ramble but any advice really would be greatly received!
    option 1
    Would be a way to achieve what you want, it would centralise your files and you would only need to backup your file server (as long as all the files you wanted backed up were on it). This could be achieved either using the client and sharing various folders or using Server which would give you more options than you would possibly need.
    option 2
    This is exactly like option 1 except that you wouldn't have to administer another mac however you may limit any future growth.
    option 3
    This option I probably wouldn't pick, you could achieve this with firewire and use a firewire to thunderbolt adapter (saves you having to buy a new iMac)
    option 4
    This option would, depending on your RAID level, give you disk redundancy but remember you would still need to back this up, as RAID is NOT a backup solution.
    I would also ask is there a pressing need to keep the old iMac in service and complicating things by having a server / NAS? Could you not just transfer all your information over to this and continue with the one backup? I would say that doing it this was would be the simplest way of achieving what you want from what I can take from your question.
    As for remotely accessing your data, if you have the right hardware the way to achieve this would be to use a VPN and connect back to your data. However a potentially easier way for you ,would be to use a service like logmein or teamviewer to connect back.
    Hope this helps, and by all means any questions please ask.
    Dan
    How to set up a basic file sharing server for my small architectural business?

  • How to Set JFilechooser to show file with the same extension in the filetyp

    How to Set JFilechooser to show file with the same extension in the filetypes??
    help

    I also don't understand, but if you mean how to display only files with a certain extension in your JFileChooser then you should have a look at the JFileChooser API:
    http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JFileChooser.html
    The introduction shows an example of how to do that.

  • How to set permissions to edit/save files copied from a Win 7 PC

    I'm working on a project where I have to generate a series of screengrabs on a PC and transfer them to my MacPro via the network for onward tranmission via email but some need to be edited first in Photoshop.
    If I'm just forwarding them via email with no changes there's no problem, but when I need to edit them in Photoshop I can't save unless I go to Get Info for the file concerned, unlock Sharing & Permissions (which requires my administrator password) and then change the 'everyone' drop-down setting from 'Read only' to 'Read & Write', then re-lock and close Get Info.
    The default permissions for the PC files as they arrive over the network are:
    nobody     Read & Write
    staff         Read only
    everyone  Read only
    I have dozens and possibly a hundred or more of these to do, so having to re-set Permissions every time is a major pain and waste of time.
    Is there something I can change either on the Mac or the PC (which is running Windows 7) so that I can just edit and save these files without all this hassle?
    Thanks,
    Michael

    http://www.lagentesoft.com/batchmod/ drag and drop permission modification software.  Be careful with this.  If you drag and drop a necessary system folder, you can render your Mac unbootable, except with an EXTERNAL optical drive.

  • How to set permissions on devicemapper block device

    I'm setting up a new RAC on RHEL5.1 using device mapper for multipath functionality.
    How should I set the permissions for the block devices I'm going to use for ocr, voting and asm?
    /dev/mapper/ocr1
    /dev/mapper/voting1
    etc.
    Regards
    Jon-Arne Storelv

    Markus,
    You are right about udev changing drastically between RHEL 4 and RHEL 5. The paper I referred to does include some guidelines for setting permissions for RHEL 5 as well. Here are some relevant extracts from the same pdf document:-
    # From udev.permissions section
    This file was obsoleted in later versions of the 2.6 kernels such as SLES10, RHEL5 and
    Oracle Enterprise Linux 5 (OEL5), that functionality was merged into the rules files, which is explained later in this paper
    ...and later you will find this example in the document
    For RHEL5, OEL5, SLES10
    • Create a file /etc/udev/rules.d/99-raw.rules with the following content
    with the following content
    KERNEL=="raw[1-2]*", GROUP="oinstall", MODE="640"
    KERNEL=="raw[3-5]*", OWNER="oracle", GROUP="oinstall", MODE="660"
    /etc/udev/rules.d/50-udev.rules on Centos 5 gives plenty of examples of settings for all different types of devices. We really need to specify OWNER, GROUP and MODE for devices that RAC will use in a rules file.
    Thanks,
    Satish

  • How to set permissions like "For all users" with Sandbox

    Hello!
    Hello!
    I am using Sandbox for Mac OS X Leopard and I've got a question to you:
    How can I set up a folder to behave like the For all users folder in the users directory?
    Greetings

    Well, sandbox sets ACL's not posix permissions. The sticky bit is a posix permission. Sand box will allow you to do something similar to the sticky bit using ACL's, but the exact duplication of the sticky bit is not possible, but something just as useful or more useful can be easily implemented.
    To set the sticky bit you will need an app called FileXaminer or the Terminal.app command line.
    to set the sticky bit simply put "1" in front of the the permissions number when you run chmod on the command line, here is an example:
    chmod 1775 /users/data/shared #assigns permissions 775 and the sticky bit#
    chmod 775 /users/data/shared #assigns permissions 775 without the sticky bit#
    note: note actual use of the chmod and chown commands will, in most cases require the sudo (super user do) command to be used with them. example:
    sudo chmod 1775 /users/data/shared #assigns temporary super user priviledge#
    The way I set my shared user's directories with ACL's is this:
    first I created folder /users/data -permissions=777 (everyone).
    I had three users so I created folders for each in /users/data:
    /users/data/user1 #this is just example-substitute real user name#
    /users/data/user2
    /users/data/user3 #etc,etc,#
    set the posix permission on each user folder 700 (owner:read,write,execute)
    set the owner and group on each one accordingly:
    chown user1:staff /users/data/user1 #substitute real user name#
    chown user2:staff /users/data/user2
    chown user3:staff /users/data/user3 #(etc,etc)#
    Now each user has their own data folder they can read and write to at will (when they are logged in to their user account).
    They can safely create and maintain their data and no one can delete it.
    Since these are shared data accounts. other users will need to read the data, this is where the ACL's come in.
    You will need to use Sandbox to place ACL's for each allowed user, on each of the user directories:
    0: user:joe inherited allow list,addfile,search,add_subdirectory,readattr,writeattr,readextattr,writeextattr,readsec urity,file_inherit,directoryinherit
    1: user:mary inherited allow list,addfile,search,add_subdirectory,readattr,writeattr,readextattr,writeextattr,readsec urity,file_inherit,directoryinherit
    2: user:sue inherited allow list,addfile,search,add_subdirectory,readattr,writeattr,readextattr,writeextattr,readsec urity,file_inherit,directoryinherit
    Basically with the above ACL's the only thing the allowed user can't do is delete files. They can copy files, they can add files, etc. This behavior is somewhat similar to what can be accomplished with the sticky bit, but much more controlled and structured. That is the beauty of using ACL's.
    Using SandBox you can taylor the permissions as you see fit for each every user. You can set permissions for an administrator to delete files as well. You can take away or add permissions for each user as you see fit. let your imagination be your guide.
    ACL's weren't meant to replace posix permissions, but rather to allow administrators to fine tune user permissions.
    Kj

  • How to set permissions for folder?

    Dear all,
    How can iset permissions for a particular folder?
    I am creating new folders for new users  who access the program. 
    Is there any way yo set permissions so that no one is able to edit the name of the folder ?
    Thanks,
    Ritesh

    Hi Ritesh,
    Thanks for the post and I hope your well today.
    You can programmatically change the Read Only and Hidden Status of a file
    in labview using the DOS prompt from LabVIEW - called
    System.Execvi.
    Here are some links regarding the DOS commands you can use,
    http://www.ss64.com/nt/subinacl.html
    http://www.ss64.com/nt/cacls.html 
    So I beleive you could find a DOS command which could alter the editting properties of the name..
    Another way to prevent the user altering the file would be to change
    the user permission's in windows.. but it could affected the code and
    most IT departments would not allow this.
    Hope this helps,
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • How to set permissions IN Open Directory USING Open Directory groups?

    Hi all,
    Apologies if I've missed this but have been searching for two days trying to figure out how to delegate permissions within the OD to a number of different OD groups and i can't seem to find any way to do this either at the command line or with WGM.
    Examples: an OD group containing those who will manage the full directory need to have permissions on all containers, child objects, and their attributes in the directory. For this one in particular I seem to be able to nest a group in the default Admin group, but this isn't really what i'm after. I need to create OD groups with the ability only to manipulate objects of class apple-computer and similarly, apple-user (really all inetOrgPerson objects). In a nutshell: how do i set permissions on specific attributes or object classes using OD groups?
    thanks for any pointers...
    -andrew

    I think i just answered my own question: Open Directory is OpenLDAP. slapd is all i need.

  • How to set DEBUG severity for File adapter in J2SE AE

    Hi,
    Can anyone help me in setting the severity level to DEBUG for file adapter?
    I have tried to set in logging.properties file as given below,
    formatter[Trace]         = TraceFormatter
    formatter[Trace].pattern =%24d [%t] %-6s %l - %m
    log[Trace] = FileLog
    log[Trace].pattern     = swb_%g.log
    log[Trace].limit     = 2000000
    log[Trace].cnt          = 5
    log[Trace].formatter     = formatter[Trace]
    com.sap.aii.messaging.adapter.severity = DEBUG
    logging components
    #com.sap.aii.axis.logs = +log[Trace]
    #com.sap.aii.axis.severity = DEBUG
    #org.apache.axis.logs = +log[Trace]
    #org.apache.axis.severity = DEBUG
    Please correct me if I have did anything wrong and sugest me hot to set the DEBUG level as soon as possible.
    Best Regards,
    Soorya

    Hi Sejoon,
    when we changed the host of XI server in one of our projects one of the things we had to change was the exchange profile entries
    http://server:port/exchangeProfile/index.html
    to see how your adapter engine is configured
    http://server:port/sld
    SLD -> Content Maintenance
    then
    Subset: landscape description
    Class: XI Adapter Framework
    buth check the exchange profile entries first
    Regards,
    michal

  • How to set up PopProxy* log file size ?

    Dear All,
    Does anybody know how to set up MMP PopProxy* log file size and rollovertime ?
    ./imsimta version
    Sun Java(tm) System Messaging Server 7.0-3.01 64bit (built Dec 9 2008)
    libimta.so 7.0-3.01 64bit (built 09:24:13, Dec 9 2008)
    Steve

    SteveHibox wrote:
    Does anybody know how to set up MMP PopProxy* log file size and rollovertime ?Details on these settings are available here:
    http://wikis.sun.com/display/CommSuite6U1/Communications+Suite+6+Update+1+What%27s+New#CommunicationsSuite6Update1What%27sNew-MMPLogging
    Regards,
    Shane.

  • How to set/get the archive file attribute?

    I am programing a (freeware!) ftp client and need to know, how to set/get the archive attribute of a local file. I was searching through whole the i-net - nothing at all!
    please help me!!

    Hi,
    Since not all operating systems support the archive attribute, this ain't included in the JDK.
    If you're using Microsoft Foundation Classes for Java, then you can use File.getAttributes(String path) and check whether the result equals FileAttribute.ARCHIVE.
    For setting the attribute, you can use
    File.setAttributes(String path, FileAttribute.ARCHIVE)
    Of course this is all Microsoft-specific stuff.
    Hope this helps,
    Kurt.

  • How to set path to jar file (classes)?

    hi,
    i have a java program which uses a jar file (lots of classes). so, i run them all in eclipse but i want to run it on a command line, like through cmd from run.
    the classes are found in a different folder, and the code snippet is found in another folder. so where or how to set the path to the jar file?

    Write
    c:/java -?
    you can use the -cp pption to use your jar file or a folder with classes.
    java -cp jar1.jar myclass.class

  • How can set permissions in iSQL *Plus

    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    SQL*Loader-704: Internal error: ulconnect: OCIServerAttach [0]
    ORA-12546: TNS:permission denied
    I have system password. how can i set permissions in isql *plus
    thanks & regards

    Fatal NI connect error 12546, connecting to:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/opt/oracle/product/10.2/db_1/bin/oracle)(ARGV0=oracleorcl)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=imp)(HOST=globalsteelweb.com)(USER=root))))
    VERSION INFORMATION:
         TNS for Linux: Version 10.2.0.1.0 - Production
         Oracle Bequeath NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
         TCP/IP NT Protocol Adapter for Linux: Version 10.2.0.1.0 - Production
    Time: 30-MAY-2007 09:27:08
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12546
    TNS-12546: TNS:permission denied
    ns secondary err code: 12560
    nt main err code: 516
    TNS-00516: Permission denied
    nt secondary err code: 13
    nt OS err code: 0

  • How to set permissions to allow reading on more than one device

    Our base permissions restrict reading to one device for 365 days with print 1 page and copy 1 page limits. For a new book we're adding to our online library, we want to allow people to read on more than one device, with a defined expiration date (January 15, 2012) and no printing and no copying. (The "more than one device" restriction is intended to allow users to transfer the book to iTunes and read it in Bluefire Reader.)
    How do we set permissions for this new book? In particular, what Read settings for devices do we use? No selection? The options in the ACS Console are not clear to us (i.e., the choice between A Single Device and Specific Device Type) and the manual doesn't offer an example. ... I'm guessing the selections should be none -- i.e., do not specify any device setting. Yes?
    Any help would be appreciated.
    Jim Lyons

    What I understand your current side restrictions to be (best if they are in a distribution right rather than base permission btw)
    <permissions>
    <display>
         <device />
         <duration>31536000</duration>
    <display>
    <print>
      <count initial="1"/>
    </print>
    <excerpt>
        <count initial="1"/>
    </excerpt>
    </permissions>
    What I think you want
    <permissions>
    <display>
         <device />
         <duration>31536000</duration>
    </display>
    <display>
         <deviceType>mobile</deviceType>
         <until>2012-01-15T00:00:00-8:00</until>
    </display>
    <display>
         <deviceType>tethered</deviceType>
         <until>2012-01-15T00:00:00-8:00</until>
    </display>
    <print>
      <count initial="1"/>
    </print>
    <excerpt>
        <count initial="1"/>
    </excerpt>
    </permissions>
    (these are looking at the raw permissions rather than the dialog in the admin console)
    Which I would describe as allow viewing on the device which fulfilled the content for one year, and in addition allow viewing on any mobile or tethered device (Bluefire Reader iPad app, android app, Nook Color, etc...) until Jan 15, 2010 at midnight PST.  One print and one copy is allowed (and can only be used on the device that fulfilled the content).

Maybe you are looking for

  • Download created XML File in batch mode // Parse XML file into single lines

    Hello! I upload a CSV file and based on that CSV file I create an XML "object". First I uploaded and downloaded it via gui frontendclass, but as it has to be run in a batch in the night I need to upload and download the data via OPEN DATASET. The imp

  • Writing a common business services Interface - J2EE?

    Hi Guys, Tanks for the previous help. The problem here is, if possible I would like to know some architectural approaches for following design question: We are basically building an enterprise application on J2EE Platform. The database tier underlyin

  • Crystal Enterprise Server Installation

    Hi all, My aim is to <b>write a crystal report</b> that will <b>communicate</b> with the BW Business Object and display the data from <b>SAP BW Server</b> and i want to publish the report through the web using the <b>portal iview. </b> I download the

  • Multiple adjustments on single brush mask?

    Can multiple adjustment effects be recorded for the single brush/mask? e.g. I want to use the same brush/mask to adjust both brightness and clarify. If this is not a feature, it's difficult to work around it because I have to construct the mask all o

  • Standard Proxy Deleted:Method To Restore

    Hi guys, From the transaction code SPROXY, I was supposed to regenerate the standard proxy so that the changes made on the PI end for the same interface reflect in ECC as well. But my mistake I deleted the standard proxy and when I try to create the