File lock during exec() use

Hi, thanks for your attention.
I'm having the following problem: (using Java 6 and Windows XP)
I want to open an image tools from my java program, using an image file already existing, during my java program execution.
But when I try to save the edited image on the same file, the image tool cannot do it, apparently because of a file write lock on the original file.
I do not keep any lock or stream open on the file (dont even open the file), and the problem does not happen every time. Can anybody tell my if this is a normal behaviour, and a possible workaround if it exists?
Here is my code
                 java.io.File executable = "c:/windows/system32/mspaint";
                 String order =   executable.getAbsolutePath() + c:/temp/image1.jpg";
                Process proc= Runtime.getRuntime().exec(order,
                        null,executable.getParentFile());
                proc.waitFor();
  // ....

By the way, I have the same problem if I try to use java.awt.Desktop or JDIC to open the file: if I try to save the edited file, I get (almost always, but not always) a "shared access violation" warning, and I cannot save it.
Curious, isn't it?

Similar Messages

  • Files locked or in use

    Suddenly tons of Word Processor document in AppleWork 6.2.9 don't open. A message says: "This file is locked or in use. Would you like to open a copy of it?" Someone has a suggestion about what I may have done or what is going on, and how to resolve this? Very much appreciated!
    iMac and iBook G3   Mac OS X (10.3.9)   AppleWorks 6.2.9

    I just experienced this exact same problem and thanks to searching the Appleworks forum and reading a few threads I was able to solve the problem.
    First of all I've been using Appleworks for a long time and never had this problem before.
    Last week I bought this Mac Book Pro and wanted to install Appleworks 6 because I'm so familiar with it (Pages looks great, but I don't need the learning curve at the moment).
    Also When I put my Appleworks cd in to install it on my Mac Bok Pro it would not install, because the icon had a circle with a slash through it -- so I called Apple care support and they advised to "just drag the Apleworks 6 folder into the new hard drive." Since I had networked my G4 and the Mac Book Pro through the Airport Extreme it was easy to do this, and it actually worked, Appleworks launched - Yeah! I have 6.0.4 and 6.2.9 in the Appleworks 6 folder.
    So today I openend a spreadsheet and did some work on it, no problem. Next I opened a WP document and got the exact message:
    "This file is locked or in use. Would you like to open a copy of it?
    Cancel (or) Open a copy"
    And I was frustrated. So I searched the Appleworks forum and followed the advice:
    1. Open the Appleworks 6 folder > Starting Points > Templates
    2. Next I see a document titled "AppleWorks WP Options.cws" and I "get info" and change "Ownership & Permissions" to "Read & Write"
    3. Just to be on the safe side I trashed the prefferences file for Appleworks and everything is working great. I even have all my templates in place as they remained in the folded called "My Templates"
    Good luck if you are having the same issue - I'm grateful people are willing to share the solutions to problems.
    Power Mac G4 (Gigabit Ethernet), Dual 450, 1280 RAM   Mac OS X (10.4.8)   15" MacBook Pro 2.16GHz/1G RAM/120 HD/128VRAM/SD-DL-

  • File locked, intern was using (file sharing). odd?

    An intern, was working on my excel file via file sharing.
    Sometimes, when I just go to open it it says, file locked - Julie working on it.... ok
    But what's odd it she left the office, closed, saved, quit, and I'm still getting this on the file.

    Check the privilages.
    Other resources
    Mac 101: File sharing
    Mac OS X: File can't be moved if locked
    Unable to move, unlock, modify, or copy an item in Mac OS X

  • T61 stopped during normal use

    My T61 got locked during normal use and I had to press the power button to force it to power off. After that when I try to power on again nothing appears in the screen . I can see that the LEDs of the HD are blinking, Bluetooth is also "on", but no message or sound.
    If I press any switch in the keyboard for long time the buffer gets full and It emits a beep sound, so looks like something is working.
    Also, I can not access BIOS during the start-up.
    Does anyone can help to solve this problem?
    Thank you in advance!

    I've helped dozens of members solve the problem, you'd need a board that isn't affected with this problem. They are rare but can be obtained. If you'd like me to check what is available you can send me a PM and we can discuss it. I also have a test you can do that may help to confirm if it's actually the gpu
    ThinkPad W-510 i7-820QM(1.73-3.06GHz) Quad Core... ThinkPad T500, T9900, 8gb SSD...FrankNpad T-60p/61p (X9000 2.8ghz) 8gb SSD ips FlexView...ThinkPad T-61p (T9300 2.5ghz) 8gb ram...Thinkpad X-61 Tablet 4gb ram...ThinkPad A-31 (1.9ghz P4 1.5gb ram)

  • I am getting frequent lock-ups and blue screens during boot up. The lock ups occur during normal use and I cannot click anything or force quit. The cursor shows something is loading, but never stops. I have to use power button. Ideas?

    I am getting frequent lock-ups and blue screens during boot up on my Mac Pro.  The lock- ups occur sometimes during normal use and I cannot click anything or force quit. The cursor shows something is loading, but never stops. I have to use power button.
    I had the Mac Defender malware and I have used apple jack but still having issues.

    I am getting frequent lock-ups and blue screens during boot up on my Mac Pro.  The lock- ups occur sometimes during normal use and I cannot click anything or force quit. The cursor shows something is loading, but never stops. I have to use power button.
    I had the Mac Defender malware and I have used apple jack but still having issues.

  • Keep getting message pop up "Error reading/writing file  "com.apple.logic.pro.cs": Logical end-of-file reached during read operation," and "The Preferences are not loaded completely. Save them to "com.apple.logic.pro.cs" anyway?" Using Logic pro 8. ???

    Logic froze while I was working on something so I forced quit.  Now every time I open LOGIC a message pops up that says:
    "Error reading/writing file
    “com.apple.logic.pro.cs”:
    Logical end-of-file reached during read operation."
    The only button option is cancel so I press it and another message appears that says:
    "The Preferences are not loaded completely.
    Do not save them, as you would overwrite the Preferences file with incomplete data."
    Then when i close logic a box appears saying:
    "The Preferences are not loaded completely.
    Save them to "com.apple.logic.pro.cs" anyway?"
    There are 3 button options to press; ok, cancel or dont save.
    I press "don’t save" cuz I don't want to ruin anything.
    I found a discussion located here: https://discussions.apple.com/message/9564253#9564253 that says if I delete the file "com.apple.logic.pro.cs" it will resolve the problem.  If I do this will I loose or mess anything up at all, automation, saved channel strips customizations, saved effects, synth, or ultrabeat customizations etc? Or especially will I loose any work I've done?  I have hundreds pieces of music files I've created.  I'm scared to mess anything up with all the hours and months of work I've done.  Is there anyway to fix this without loosing anything?  I'm using Logic Pro 8.
    Thank you

    You can safely delete this file - its the preference file for control surface settings - you haven't said whether you're actually using a control surface or not, if so, you will have to set it up again. A new file will be created when you fire Logic up again, but of course it will contain default settings. If you have a complicated control surface setup, remember to keep a backup copy somewhere in case any future problems arise.
    Other than that, you really have nothing to be scared about - hopefully your problem is as simple as that and there isn't an underlying problem (a corrupt hard drive, for example). You seem concerned about losing work, so I guess you want to think about backing that up on a regular basis too. If you're saving your projects to your system drive, do get an external one for this. And also check that you have plent of free space on your system drive - you need to keep about a quarter or third of it free for your OS and programs to run properly (some temporarily stored files can be quite large).

  • Open Appleworks - File is locked or in use

    Our students are using Appleworks 6. When we came back to school this year and tried to open the application, several students got this error message: The file is locked or in use.
    We've gotten this error message in the past when trying to open an Appleworks document, usually when students are opening a file I have put on the server for them and too many are opening it at once. We've never gotten it when just trying to boot up the application.
    Any ideas what might be causing this and what the fix is?
    Thanks

    I could only find a terse explanation of it...
    About AppleWorks File Repair Utility
    This utility is designed to fix AppleWorks documents that have become damaged when the documents are saved from AppleWorks 6 running on a Mac OS X 10.2.x client to an AppleShare or compatible file server.
    It's purpose seems very narrow in scope.

  • I cant use the highlight, underline, or strikethrough function in a specific pdf file. The file isnt locked. I used to highlight texts from that file before the latest update. The problem occurs only with that file. Urgent need. Please help. Thanks!

    i cant use the highlight, underline, or strikethrough function in a specific pdf file. The file isnt locked. I used to highlight texts from that file before the latest update. The problem occurs only with that file. Urgent need. Please help. Thanks!

    Chester31,
    Thank you very much for sharing your file with us!  Now that we are able to reproduce the problem at our end, you may stop sharing the file on Acrobat.com.
    Do you know when this problem (for not being able to add new highlight/strikeout/underline) has started?  Did you update your iOS from 7.x to 8.0 recently?
    We will continue investigating the problem and let you know what we find.
    Thank you again for your help.

  • Problem Loading pdf using AxInterop.AcroPDFLib (file locked)

    Hi,
    I'm currently using AxInterop.AcroPDFLib with C# in a winform application.
    Purpose is to display PDF files in my application. Thoose files are located on a share directory.
    Everything works fine, the program is installed on multiple pc that display the file at the same time without problem.
    BUT, when i open the same PDF file on a computer using acrobat pdf reader, i can't open the same file using the AxInterop.AcroPDFLib dll.
    After some deep search on the files, on the servers, ... it seems to be linked with file locking.
    Let me explain :
    when the file is opened by the AxInterop.AcroPDFLib dll, no lock appears on the server ( share directory ) or at least it appears and is released in the same second.
    when i open the PDF file via acrobat reader, the lock is set, and remain until i close the file in the pdf reader.
    which means that when someone open a file, all the computer using the AxInterop.AcroPDFLib ares blocked and can't start reading the file.
    Is there a way to configure the AxInterop.AcroPDFLib to allow reading on locked files (locked for reading)
    Thanks
    Mike

    I have tried with both Reader 8.xx and 9.xx
    Same behavior.
    After deep investigation, i have found that when i open a file using the reader, this file is marked as opened for "read" on the server, and in that case, the ocx can't open the file...
    when the file is close by the reader, the lock is removed and the ocx could open the document.
    I found also that when the ocx open the file, this file is not locked on the server, which allows other computers with the same ocx to open the same file on multiple workstation (which is the behavior i was expecting).
    thus why is the ocx blocked when a file lock is present on the server for the file to be opened by the ocx...
    Mike

  • "Can't open illustration.  File is locked or in use.  ID = -54"

    "Can't open illustration.  File is locked or in use.  ID = -54" shows up when I try to install the Ai2Canvas.aip plugin on my Macbook Pro.  I'm using Illustrator CS5.  What do I have to do to make this plugin work?

    This one should be the CS5 one http://visitmix.com/labs/ai2canvas/

  • This file is locked or in Use.  Would you like to open a copy of it?

    I use AppleWorks more than anything else, and understand the work arounds. Here is the problem, everytime I open a previous file I get this message, "This file is locked or in Use. Would you like to open a copy of it?" I copied applications from a previous iMac. When I try to open copy of the document, I get the above message. When I try the save command I can't, even a save as doesn't work either. Any thoughts or ideas for a resolution.

    I have found that this problem is due to OS X's ownership & permissions. When you create & save a document in AppleWorks in OS X the file is owned by you & no one else can make changes without your permission. If you don't have the same account name as on the other Mac, you'll need to change the permissions. Click on the file to select it, then choose "Get Info" from the File menu. Now click on the triangle next to "Ownership & Permissions" & change Group & Others permissions to "Read & Write."
    The save problem may be solved by deleting the AppleWorks preferences.

  • Exclusivel​y locked files warning during startup on my A100 Satellite

    I get a warning about (at least?) 2 exclusively locked files occuring during startup. How do I identify them and how do I "unlock" them? I am not going to ask how they got exclusively locked. 
    I have tried updating the bootup file but I'm told by the updater that my bootup file is identical to the update.
    I have done a complete Vipre scan which has pronounced my laptop to be clean. 
    Thnaks,
    John

    Which Satellite A100, John? What's the part number?
    Which Windows?
    Please quote the precise message you get on startup. Put it on a line by itself. No paraphrasing. Spelling counts.
    -Jerry

  • Office 2010 & 2007 - Excel and Access File Locking Out On the Network With Multiple Users

    This is also posted in the Office 2010 - IT Pro General Discussions, but was suggested to repost here, since a definitive answer was not found.
    Hi,
    An issue that's happening is that Excel and Access files are locking on the network. We're currently using Office 2007 and 2010.
    Here are some different scenarios that are happening:
    When opening the file it is locked out by “User X” which is the person that has the file locked out and no one else can open the file.
    When opening the file it is locked out by “User Y” which is NOT the actual person, but is locked out by “User X” and no one else can access the file.
    When opening the file  it is locked out by “…another user” which is generic and no one else can access the file.
    The two more common events are incident 1 and 2 with 3 happening the less common.
    This message will continue until the sessions are closed through computer management on the file server.
    The file server is running Windows Server 2003.
    This does happen on both Windows XP and Windows 7 clients.
    This does happen for users using Office 2007 and Office 2010.
    There are two sets of Office 2010 Users when it comes to patches. Everyone has the most current patches with Office 2010 SP2 while anyone that has Microsoft Project 2010 is using all the current update before Office 2010 SP2.
    All users that are using Office 2007 have all the current patches and service packs.
    Another variable is that we have users that will leave a file open on the network for 3+ days and after a while it will lock the file out.
    Also we have Shadow Copy that runs daily on the system which I'm not for sure if that impacts anything if a file is opening during that time.
    Any ideas on how to mitigate the lock out issues would be appreciated.
    Thanks,
    Binary Process
    Edit November 12, 2013: This issue can occur if and if not another person actually has the file open. If the person doesn't have the file open then there is a hung connection which needs to be disconnected by going to the Computer Management of the File
    server.

    Hi Binary,
    I know that the description of the hotfix does not relate to the issue. The purpose is to install it for upgrading SMB related file.
    A similar issue I encountered before:
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/b7fcc59b-52d9-4a02-863a-1a529bcb8cb1/temp-doc-etc-files-dont-close-after-a-file-closes-this-causes-locked-files?forum=winserverfiles
    It is resolved by upgrading SMB files so maybe it will help on your case.
    Another hotfix which may related:
    http://support.microsoft.com/kb/983458
    If you have any feedback on our support, please send to [email protected]

  • ITunes Library File Locked

    Hi,
    Have been using iTunes 10.5 on my WinXP machine - no problems.  During a movie download tonight, iTunes crashed.  Tried to reopen and got the infamous error "iTunes Library file locked or on a locked disk..."  Tried several remedies listed. 
    Verified that MyMusic folder and contents are not READ ONLY.  I am unable to rename, edit, or move the file...she's locked up tight.
    Tried repairing the Windows Registry assignment using the Tweak UI utility discussed in another thread.  No joy.
    Tried starting iTunes from another account on the PC - iTunes boots fine.
    Pulling my hair out (what little is left)...Any ideas out there ???
    HELP !

    Fixed.  For those using WinXP...Here's what I had to do:
    It was a file properties thing as mentioned in other posts, but to change the file properties...
    1.  Boot Windows in SAFE MODE by holding F8 down during bootup
    2.  Log on as Administrator
    3.  Navigate to the iTunes Libary.itl file (My Music/iTunes)
    4.  Right Click and pull up the file properties
    5.  Under Security, re-add the user account to the file permissions
    6.  Then change file permissions to FULL (Read/Write/Edit...)
    7.  Reboot & Viola !
    Once you unlock the write protected status (which got defaulted to the Adminstrator account), iTunes opens just fine. 

  • File Locks and SMB shares with ML

    I've been doing a lot of research on SMB and the way it locks files during access. I've made a lot of ground work in my research but could use a little further assistance from this support community.
    The symptom is simple to explain: Users are occasionally being prompt for a username and password when attempting to rename or move files and folders.
    After doing some research on this topic, I have discovered that there is a direct relationship to files being open on the server at the time the user is attempting to rename or move the folder. The following thread, albiet old, appears to have nailed the problem on the head http://arstechnica.com/civis/viewtopic.php?p=24558131. In particular, there appears to be file locking happening when preview is turned on through the finder. I've had all users remove preview from their Macs and this appears to have helped reduce the occurances of the password prompt, but has not completly solved the problem. This is also a work around, not a fix.
    I've been using a series of command to help me trace the problem including openfile.exe on the Windows 2012 Storage Server (sharing the files via smb only) to discover who has what files open on the server, and the lsof command on the client workstations to discover what process has the file open. So far, the finder is consistently the only thing with the file open... even with the finder preview turned off. I've also found that the "open file" is simply the fact that the offending users Mac has a finder window with just the folder open (none of the files within the folder or previews open).
    Is the real solution to simply close all finder windows when you're done working in a folder, or is there more that anyone can think of to help me find out exactly what is holding the file lock? Is this a known bug in the SMB implementation of ML? Can we expect to see a fix with Mavericks which will now be using SMB2.0?
    Any help or information anyone can provide would be greatly appreciated. I have a bunch of documentation on this issue and would be happy to share. Please let me know if anyone needs any additional details.

    Hello all - many apologies for my delay in posting here; and Squiggle, thanks for the second-hand nudge. As Stephen said we have been testing a solution concerning a setting in Finder's view options for the last few months, and these seem to have solved the issue in hand.
    Essentially, we found that Finder was holding files open whenever the 'Show Icon Preview' option was set, on any of the four folder views, on any client machine accessing the share. Below is a piece of documentation I wrote up for our Service desk explaining how to diagnose and manually fix this issue on the client:
            - In Finder, open any folder
            - Click on the cog icon and select 'show view options.' Check that, in the dialogue box which appears, the 'Show icon preview' box is not checked. Click the other three Finder views and check it's turned off here too.
            - Click 'Use as Defaults'
    In order to make this change remotely on multiple machines, you will need to change the clients' com.apple.plist files, and set every instance of the <showIconPreview> key to <False>. This is nested within several key / dictionary pairs in com.apple.finder.plist, once under <standardViewOptions> and thrice within <standardViewSettings>. As Stephen has already mentioned, the fact that this key is nestled deep within compound dictionaries seems to render them untouchable by defaults, though I would be very happy to be corrected on this.
    How you push this change out will depend on your management system. We had been using Casper to
    to create a managed preference pertaining to <standardViewOptions> and <standardViewSettings> within com.apple.finder.plist. These contained as values the entire dictionary associated with these keys, with the value for each <showIconPreview> set to false. This was then applied at a User Enforced Level (running every logon after Finder has set up the system defaults).
    As a side note, I have found that certain machines (Such as the 10.8.3 machine I'm working on now) contain a key named <FK_StandardViewSettings>, which I have been unable to ascertain the purpose or origination of. These don't seem to affect the fix, so we've left them alone.
    Irritatingly, Casper has dropped support for custom Managed Preferences in their latest release, so this problem has now resurfaced. I will keep this page updated with any fixes or workarounds I find.
    Hope that helps,
    Josh Smith

Maybe you are looking for

  • How to deactivate notifications about new mail?

    When I have an active mail account, I always get a notification when a new mail arrives. Can this be deactivated? I'd rather check manually at my own time, rather than having these notifications pop up several times every day. Solved! Go to Solution.

  • 'You can't open the application "Logic Pro X" because someone else is using it.'

    Hello. I have two user accounts on my MacBook and if I attempt to open Logic Pro X in 'user 2' while it is already open in 'user 1', I get 'You can't open the application "Logic Pro X" because someone else is using it.' Now I know I can simply quit L

  • I want to reload 3.6, since 4.0 won't work to my satisfaction.

    I tried upgrading my Win 7 computer to 4.0, but didn't like the new look. After a long chat session with one of your techs, I decided to uninstall 4.0 and reinstall 3.6 Where can I find a download for 3.6?

  • Default Email Addresses Picked From Address Book in Groups?

    Many of the records in my address book have more than one email address. When I am sending an email to that individual I start to type their name and am presented with the various choices -- I believe the address I most recently used (or maybe most r

  • Speedgrade render speed

    Speedgrade's render speed seems to be radically variable. If I go to check my email or throw on a podcast in iTunes (neither are touching the drives involved in rendering, so it doesn't seem like an I/O issue) then the render drastically drops speed