File write permission

Hi,
I am writing a java application which have a module that have the functionality of writing something to a file. I have created an installer for my application and it works fine. I am able to create , modify and read the file using the application.
The issue is once I created and modifed a file logging in as say user1, I am unable to access the same file when I tried to modify it using the same application by logging in as different user say user2. It tells user2 don't have the permission to write to the file.
How can I fix the issue? Is it possible to give permission to a file which I am creating using the application. I am using jdk1.5.
Any help would be greatly appreciated.
Edited by: JavaXchanges on Mar 31, 2009 10:52 AM

r035198x wrote:
The methods to set permissions were added in Java 6.
You could open the API specs for 1.5 to see what's available for yourself. Perhaps you could try issuing an OS command to set the permissions using Runtime.exec ...Yep, exec is probably easier than calling O/S libraries via JNI... and maybe (shock horror) more reliable, and actually faster ;-)
Cheers. Keith.

Similar Messages

  • Error: Insufficient disk space & file write permissions

    when my client edits a page and the click save i get the following error:
    the permissions for the includes folder are 755.
    I dont have this problem on other websites however and they are setup the same way.

    I am having the identical problem this week with incontext editing of a website I could edit fine last week with incontext editing but this week I cannot save changes to any page I try to edit, even though I've not made any changes to the site in the week since.
    If I Edit one page and try to save the changes, I get one of two errors:
    "The operation could not be performed because a problem occured while attempting to connect to the server. Please check your connection and try again."
    or
    "The operation could not be performed because there is insufficient disk space or the file write permission is not granted."
    I then went to the Incontext editing control panel, Manage Users, Configure Site and there I can click Test Connection and it reports it can successfully connect to the site using FTP. But when I try to Save that Configure Site (even though I've made no changes except to click Test Connection) I get two different errors each time I try...
    The first error reported was the unable to connect to the server error.
    "The operation could not be performed because a problem occured while attempting to connect to the server. Please check your connection and try again."
    or
    "Configure Site Error. An FTP error occurred. A test file could not be copied to the specified Host Directory. Your FTP user may not have sufficient permissions to access the folder and/or its content."
    I am 100% certain there is no problem on the server with insufficient disk space or file permissions, so this is an incorrect error message being reported by InContext Editing. I can connect to the site and make and save changes with Dreamweaver with the identical FTP settings. This site is on a server at GoDaddy that has plenty of disk space and I can see that all the permissions on site folders are set correctly.
    At this point I have a very frustrated client who is anxious to edit web pages but cannot.

  • TS1717 unes, i have windows 8, i get the message, "the itunes Library .itl file is locked, on a locked disk, or you do not have write permission for this file.  how did this happen, how do i fix this?

    the message"The itun, library .itl file is locked, on a locked disk, or you do not have write permission for this file". i have windows 8. how why did this happen? how do i correct this and prevent another occurance?  I am able to access itunes on my i5, ipad, and my old i4 that i use solely as my ipod now. At the time  problem occurred, i was connected to ext hard drive that hold over 190GB music, to add to my library. I am now unable to add to my library using my laptop.  any advise/help is greatly appreciated!!

    I just had the same problem and was able to fix it after trying a couple of things I found after a search.
    The solution that worked for me:
    Find iTunes folder - it should be in C:\Program FIles (x86) or similar depending on your operating system
    Right click the entire folder (no need to open it) and click properties
    Click the security tab
    Click edit and highlight the user name under which you logged in.
    Click the box next to full in the allow column, which should check everything
    Click apply
    Open iTunes
    This worked for me.

  • How To Fix: "The iTunes Library.itl file is locked, on a locked disk, or you do not have write permission for this file."

    I can't reopen my iTunes after I have to force quit when it does not respond. I get this message:
    "The iTunes Library.itl file is locked, on a locked disk, or you do not have write permission for this file."
    I've read to do the solutions. I right clicked on both the iTunes and Music folder and went to info for each. On both the lock at the bottom of the Get Info was locked. All of my users including admin can read and write all files within those folders. They are even a shared folder. I clicked on the lock to unlock it, typed in my admin password, and went to the gear to apply to all files inside. After doing that I keep getting the saved message.
    I tried another way that I've found online to move my ituneslibrary folder to the desktop and then open my iTunes. In theory the iTunes is supposed to ask for where the iTunes library is. Once that is prompted you quit iTunes and drag the iTunes Library folder back to the folder from the desktop and reopen iTunes to apprently solve the problem. However, when I move the iTunes Library file to the desktop and try to reopne iTunes the icon just keeps bouncing and when I right click the application does not respond.
    This problem is only resolved if I restart/shut down my macbook pro which is a 15-inch Core 2 Duo with intel. It will be 5 years old in December. I currently have Lion and the latest iTunes 10.5. This problem started in late December. 

    If you hold down the option key when starting iTunes, it will allow you to select a library or create a new one.
    You can create a new one, and then add all of your iTunes music back in by simply dragging the old iTunes music file onto iTunes.
    There are more detailed instructions at http://support.apple.com/kb/HT1451#
    It will show you how to re-build your iTunes database file.

  • ITunes won't open, I get this message: The iTunes Library .itl file is locked, on a locked disk or you do not have write permission for this file.

    iTunes won't open.
    I get this message: The iTunes Library .itl file is locked, on a locked disk or you do not have write permission for this file.

    This may indicate a corrupt preference file with iTunes trying to open the wrong location. Try holding down shift as you launch iTunes then choose the correct file, normally <User's Music>\iTunes\iTunes Library.itl. See iTunes: How to open an alternate iTunes Library file or create a new one.
    tt2

  • HT1527 iphone wont open it says the itunes library.itl file is locked on a locked disk or you do not have write permission for this file. nothing l  do seems to help thanks

    Have tried to connect and sync my iphone 4 to my computer in itunes but this message keeps coming up The itunes Library .itl file is locked on a locked disk. or you do not have write permission for this file.

    I have tried both suggestions, unfortunately neither fixed this for me. Hoping there's another possible fix. Thanks in advance. 
    Empty/corrupt iTunes library after upgrade/crash and/or Repair security permissions for iTunes for Windows.

  • I can't open itunes it's giving an error "The Itunes Library.itl file is locked, on a locked disk, or you do not have write permission for file.

    yes itunes will not open it gives me an error that the file itunes library.itl is locked or on a locked disk or i don't have write permission for it.

    Make sure that you have closed all programs that might be using the iTunes library.itl file. I would hit CTRL + ALT + DEL buttons and enter the Task Manager - from there end any unnecessary program running in the background.
    Next try to start iTunes again. If it fails, restart PC, do the same with Task Manager and try to open iTunes again.

  • My iTunes won't open! It keeps saying 'The iTunes Library.itl is locked on a locked disk or you not have write permission for this file.' Please Help!

    My iTunes won't open! It keeps saying 'The iTunes Library.itl is locked on a locked disk or you not have write permission for this file.' Please Help!

    this may happen on external drives if:
    The external drive was hotpluged (removed) without going the correct "eject" way
    The iTunes library (database) got corrupted
    First Aid for external drive
    Close iTunes
    Unmount (eject) external drive the right way.
    Mount drive again
    Go to Workplace -> right click external drive -> choose "clean up" This will force the filesystem to rescan the file structure of the drive and rebuilding the file system table and journaling file.
    After the tool shows "done" (could last some time depending on size of drive) restart iTunes
    If your iTunes library is on your internal drive, this may happen
    The system was not shoot down correct, e.g. "pulled the plug"
    The iTunes library (database) got corrupted
    First Aid for internal hard drive
    Close iTunes
    Reboot system
    Go to Workplace -> right click external drive -> choose "clean up"
    After the tool shows "done" (could last some time depending on size of drive)
    Reboot system, restart iTunes
    If none of the above fixes your problem, post here.
    Lupunus

  • I'm trying to share to Media Browser a 20 minute still slide show with music and text. I have tried several times to save at 1080 HD, but just before it's finished, a message box pops up saying "File already open with write permission."  What's this mean?

    I'm trying to finalize/share to Media Browser a 20 minute still slide show with music and text. I'd like to finalize it 1080 hd and have tried several times, but just before it's finished, a message box pops up saying it can't be done because "File already open with with write permission."  What does this mean?  All files are closed; this iMovie project is the only thing open.  Does it mean one of the song files from iTunes? And should I just settle for saving it as a "large" file, which is what I'm trying right now?
    Thanks,
    Jamie

    Hi
    Error -49 opWrErr  File already open with write permission
    Trash the preference files while application is NOT Running.
    from Karsten Schlüter
    Some users notice on exporting larger projects from within iMovie that this operation is aborted with an 'error -49'
    This issue occours only on MacOs machines using 10.7x
    try switching-off the Local Mobile Backup
    in Terminal copy/paste
    sudo tmutil disablelocal
    Re-launch Mac
    See also this post
    https://discussions.apple.com/thread/4434104?tstart=0
    Yours Bengt W

  • I've just opened iTunes on my Mac with an error "The iTunes Library.itl file is locked, on a locked disk, or you do not have write permission for this file.". I created a shirred library so that all users on my Mac can access the same library. Help?

    I have just opened ITunes on my Mac and the following error occurred "The iTunes Library.itl file is locked, on a locked disk, or you do not have write permission for this file.". When I setup my Mac I created a shared user area to contain my ITunes library so that I could share it with another user logged onto my Mac. However the error above gives me the impression that the library file is locked... I've checked and it does not seem to be locked under the "get info" fie information. Has anyone come across this before and found a solution?

    You also need to make sure you have both read and write permission for the file, or for the whole iTunes folder for that matter.  That's also done in Get Info for the file or folder concerned.
    Read the part about changing permissions on the iTunes folder in: https://discussions.apple.com/message/11583914

  • HT203167 I get an error message "The iTunes Library.itl file is locked, on a locked disk, or you do not have write permission for this file."....

    Hi I have downloaded the latest iTune Software on Windows 7. I went to open the file and it won't execute, I small box keeps popping up with this message:-
    "The iTunes library.itl file is locked, on a locked disk, or you do not have write permission for this file".
    I have tried to change the permission but nothing happens. Can anyone please give help me or give me some advise how I can fix this problem.
    Please email me at [email protected]
    Thanking you kindly
    Marina Dunn

    I have tried both suggestions, unfortunately neither fixed this for me. Hoping there's another possible fix. Thanks in advance. 
    Empty/corrupt iTunes library after upgrade/crash and/or Repair security permissions for iTunes for Windows.

  • Just finished using iTunes, closed out and then tried to get back in.  Got this message "he iTunes library .itl file is locked, on a locked disk, or you do not have write permission for this file."  How can I get back into iTunes ?

    I just finished using iTunes, closed out and then tried to get ack in.  Got this message "The iTunes library .9tl file is locked, on a locked disk, or you do not have write permission for this file."   How can I get back ino iTunes ?

    I actually figured it out...I had to go to the iTunes Library Extras.itdb file and give myself permission to have full control.  THEN, I could go and estore a previos version.  Once I had done this, I got the same message for iTunes Library Genius.itdb . . . I did the same thing with it and Voila'!!
    Hope this helps...
    SVT

  • I receive the follwing error message when trying to open my ipod touch/itunes "the itunes libary.itlfile is lockedon  a lockdisk or you do not have write permission on this file. How do I resolve this problem?

    I receive the follwing error message when trying to open my ipod touch/itunes "the itunes libary.itlfile is lockedon  a lockdisk or you do not have write permission on this file. How do I resolve this problem?

    Repair iTunes Security Permissions
    Right-click on your main iTunes folder and click Properties, then go to the Securitytab and click Advanced. Use the Change Permissions... button grant to your account (or the Users group) and SYSTEM full control of this folder, subfolders and files, then tick the option to Replace permissions entries... which will repair permissions throughout the library. When complete switch to the General tab, click in the Read-only check box to clear it, then click Apply.
    If you don't have the option to change the permissions then use the Owner tab and Edit... button to take ownership from an account with administrator privileges. Tick the option to Replace owner on subcontainers and objects.
    Repeat with the media folder if it isn't stored inside the main iTunes folder.
    If you've brought over the library from another computer you may also want to remove any "mystery" identities (S<string of dashes & digts>) that have come over from the old computer...
    The images above are from Windows 7. Hopefully the system isn't too different in Windows 8.
    tt2

  • I've been receiving an error message, "That the .itl file is locked, on a locked disc or you do not have write permission". Can someone tell me how to unlock the file or disc?

    I've been receiving an error message, "That the .itl file is locked, on a locked disc or you do not have write permission". Can someone tell me how to unlock the file or disc?

    theres no - in "itunes" its all one word
    try right clicking and running itunes as adminstrator or try on a different user account

  • TS1277 iTunes is unable to run. I tried to run iTunes and a message comes up that says "the iTunes library.itl file is locked, on a locked disk, or you do not have write permission for this file." what is the solution to unlock it ?!

    iTunes is unable to run. I tried to run iTunes and a message comes up that says "the iTunes library.itl file is locked, on a locked disk, or you do not have write permission for this file." what is the solution to unlock it ?!

    I have tried both suggestions, unfortunately neither fixed this for me. Hoping there's another possible fix. Thanks in advance. 
    Empty/corrupt iTunes library after upgrade/crash and/or Repair security permissions for iTunes for Windows.

Maybe you are looking for