CFFILE Holding File Locks

I have a CF page that reads some tab-delimited text files for
processing. After it reads a file it then calls a CF page to move
the file to a new location. It moves the file, but it does not
delete the old version -- and a filesystem delete on the file fails
-- it appears as if the CF server has the file locked. If I shut
down the server and restart it, it clears the lock.
<cfif #url.vendor# is "LOWES">
<cflock timeout="10" scope="server" throwOnTimeout="no"
type="exclusive">
<cffile action="move"
source="c:\edifiles\export\#url.fileno#"
destination="c:\edifiles\export\done\lowes\#url.fileno#">
</cflock>
</cfif>

Generally when manipulating files you used a named
<cflock> instead of a scope like so:
<cflock name="#Variables.myFileName#" timeout="5"
type="exclusive">
In your code in the second example I'm not sure about the
function of the loop at all... I guess you are trying to delay to
make sure the copy operation completes before deleting. But looping
from 1 to 10 is arbitrary and depending on other concurrent
processes, server speed, RAM, etc. and so basically it is
unreliable.

Similar Messages

  • File locking with OSX Server & Microsoft Word

    We have a small office LAN based on a Airport Extreme bases station. Periodically Microsoft Word reports a break in connection to the shared folder where we store documents to get disconnected. When that happens and the user reconnects to the share, the user gets the file read-only message for the Word document that was open at the time.
    I have found that in order to clear the read-only flag, I have to restart the server and open the Word file on the server with the ID of the user who was editing the file on the remote computer. Only that seems to clear the file locking that causes the file to be read-only.
    I cannot figure out a less drastic way to release the lock file. I don't see any hidden temp files in the same folder as the document that is locked for editing found by ls -a or in the root direction of the shared folder in the .TemporaryItems/folders.<UID> that seems to be holding the lock.
    I have run chflags nouchg <Word file> from Terminal, but that seems to have no effect either. I also used xattr to see if there were any locks held that way, but I don't see anything that way either.
    File sharing to Macs only, which are configured just to use AFP through OSX Server.
    Does anyone understand how the file locks of Word documents can be released directly with out restarting the server?
    I should add that the underlying problems seems to be WiFi related. The behavior is that the WiFi connection seems to break long enough that the shared volumes disconnects. Outlook also causes a break. This behavior seems to have started with 10.9 and the purchase of new Retina Display MacBook Pros. I turned off AppNap on the Office applications but that is not clearly helpful. I also have been told the problem seems more likely to occur when Word is open in the background and another program like Outlook is in the foreground.
    Any suggestions appreciated.

    Apple write an operating system and also produce file sharing software as part of that to be used as a file server. Apple provide documentation for third-party software developers on how they should write software to work with Apple's software and also give those developers early access to new versions so those third-party developers can test and if needed make adjustments and issue updates to cope with any Apple changes.
    Some third-party developers are good at dealing with this, some are bad, and some totally ignore what Apple does and give the impression they don't care if their product works properly or not. I think we can all judge where Microsoft sits.
    It appears Microsoft have never paid any attention in particular to how Apple expect file-locking to be handled when accessing files on a Mac server. There have been problems for years and years and years with Office. Two other problems I have seen which seem different to yours but probably related are -
    With Office documents it is supposed to be possible for more than one person to edit the same file at the same time, consider it a miracle if this actually works
    With Office in particular Word, there is an auto-save function, unfortunately the way this seems to be implemented it seems that Word creates a new temporary file each time it auto-saves the document and keeps all the previous temporary files open still, this eventually means potentially over a hundred temporary files are open - just for one Word document and you can then hit a limit on the total number of files you are allowed to have open at the same time. At this point further auto-saves fail, and you also encounter great difficulty doing a real full save of the document.
    I do not hold Apple completely blameless over this issue, it is likely their file-locking implementations change too often, and have inadequate documentation, however even considering this a company the size of Microsoft with the amount of sales (and profit) they derive from Office for the Mac has no excuses at all for failing to put the effort in to resolve any such clearly critical problems.
    We could go on and on about other areas where Microsoft don't play by the (software) rules. Even in Windows Office does not obey the standard print dialog rules Microsoft specified themselves!
    Unfortunately not only is Office for Mac upgraded infrequently, but even when new paid for upgrades are released Microsoft have a history of still not fixing bugs. It goes without saying that a mere free update is even less likely to actually fix a bug, typically such free updates only address security issues. The next version of Office is going to be Office for Mac 2014 see http://www.macworld.com/article/2106643/microsoft-will-release-a-new-version-of- office-for-mac-this-year.html
    One area I confidently predict Microsoft not to resolve in Office for Mac 2014 is that fact that Word for Mac still does not support right-to-left languages like Hebrew and Arabic. This is despite the fact that OS X itself has supported this for years and years, and despite the fact other Mac programs support this including the free TextEdit and Pages - both of which can read Word files. Some people may remember that at one point the Israeli Government temporarily banned all Microsoft software over this issue. See http://apple-beta.slashdot.org/story/03/10/15/2215249/israeli-government-suspend s-microsoft-contracts This issue goes back over TEN years!!
    I note that Microsoft has now taken their OfficeForMac blog offline, probably due to the weight of criticisms. I would not say it is due to out-right anti-Microsoft hate, that war ended long ago. We just want products that work. I myself do use Microsoft products, even at home - where they are the best solution, so I use Microsoft Media Center for example. Sadly this is now being neglected by Microsoft.

  • 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

  • Really persistent file lock

    I've got a problem where connections with certain file locks do not seem to close for more then a day even on reboot / shutdown of the client.
    We have a .net/C# based document processor that runs on every user session that requires it that manages to put some weird file lock on its log files that are located on users home directory's (unable to change that).
    For some reason our OES11 server every now and then does not close the connection holding the log file open and users can not start the processor in the morning because it can not access its own log file.
    This -occasionally- happens with normal workstations running XP but more frequently on Win2k8r2 with Xenapp although all our Xenapp servers get rebooted daily.
    I would expect the OES server closing the connections upon reboot of the Xenapp servers or when the workstation is turned off for 10+ hours. It would appear it takes somewhere over 24 hours for the connection / lock to clear but I have nothing to back this up.
    Can anybody explain this behaviour and/or come up with possible workarounds, I always assumed connections were actively checked to see if they were alive.
    I also need to have a talk with the people where this amazing piece of .NET software came from about the way they lock files.
    Thanks

    In article <[email protected]>, Conz wrote:
    > For some reason our OES11 server every now and then does not close the
    > connection holding the log file open and users can not start the
    > processor in the morning because it can not access its own log file.
    >
    The default watchdog timeout process isn't as effective as it used to be
    on NetWare, but there are things you can do. I had hit it with OES2 and
    mostly resolved with http://www.novell.com/support/kb/doc.php?id=7004848
    and while looking for that TID found this useful looking one.
    http://www.novell.com/support/kb/doc.php?id=3138614
    Andy Konecny
    Knowledge Partner (voluntary SysOp)
    KonecnyConsulting.ca in Toronto
    Andy's Profile: http://forums.novell.com/member.php?userid=75037

  • File locking issue

    hi ,
    I use a java applet for ftp images upload using a third party ftp API library (edtftpj).
    i run my applet from browser but I'm experiencing a strange issue :
    -i upload a file & leave the browser opened.
    -i then open this same file with gimp or photo-shop & get 'file in use' error.
    -if i close browser & try opening file ,the file is opened correctly.
    I investigated the issue more thoroughly and here are my conclusions :
    1) First i made sure to close all File's streams in the applet.so I'm sure i eliminated this issue of forgotten opened file streams .
    2) also i made sure to close all network connections that might be holding the File lock.
    It's clear that another process is still locking the File & preventing access to it.
    i used a win32 program (procExp) to monitor active processes . it turned out that javaw.exe is the process that use the File. i was convinced of this fact with a simple experiment : if i destroy the applet (closing applet's browser window -not necessarily all browser instances-) then in this case the file lock is released and i can access and delete File correctly.
    my questions :
    -How to instruct javaw.exe to release the File lock ? (is that possible at all to do ?)
    -is it a bug in JVM ? (i'm using jdk1.4.2)
    -or is it an OS centric issue related to windows only ?
    i would appreciate your ideas about this problem .
    thanks.

    Exactly, and I've been aware of all that since about 1997. I don't know whether that was supposed to answer my question to you as the OP but it doesn't.
    Sadly I misread your second-last post to say that you are using Thread.stop(), which you're not, so that explains some of the confusion. But I don't understand why you say Thread.interrupt() doesn't release the resources. It isn't supposed to. It doesn't do anything except set a flag and cause your thread to throw an InterruptedException if it's calling Object.wait(), Thread.sleep(), or certain I/O routines. It's up to your thread to react appropriately, and/or to call Thread.isInterrupted at appropriate intervals.
    So Thread.interrupt() (a) provides the boolean flag you need and (b) also interrupts your thread under some circumstances. So it is definitely the solution you should be using: call Thread.interrupt() to tell the thread to exit, and call Thread.isInterrupted() in the thread itself to know whether to do so.

  • File lock() method problem

    I know this may be a common question, but can someone explain why this code:
    import java.io.*;
    import java.nio.channels.*;
    import java.util.*;
    public class TestFileLock
         private static File file;
         private static RandomAccessFile fileRandom;
         private static FileChannel fileChannel;
         private static FileLock fileLock;
         private static String process;
         public static void main(String[] args)
              process = args[0];
              try
                   file = new File("/home/fauxn/work/blast/java/java_blast/test.log");
                   //fileWriter = new FileWriter(file, true);
                   fileRandom = new RandomAccessFile(file, "rw");
                   fileChannel = fileRandom.getChannel();
                   for(int i =0; i < 1000; i++)
                        writeLogFile(process + ": happy days\n");
              catch(Exception exception)
                   System.out.println(exception.getMessage());
                   exception.printStackTrace();
         * Method lockes the logFile and then append the string to the file and unlocks the file.
         * @author Noel Faux.
         * @param s The string to be written to be appended to the file.
         private static void writeLogFile(String s) throws IOException
         System.out.println(process + ": trying to lock the log file");
         fileLock = fileChannel.tryLock();
         while(fileLock == null)
                   System.out.println(s + ": waiting!!!!");
                   fileLock = fileChannel.tryLock();
         System.out.println(s + ": logfile locked");
              fileRandom.seek(fileRandom.length());
         fileRandom.write(s.getBytes());
              fileLock.release();
              System.out.println(s + ": logfile unlocked");
    produces this error:
    Invalid argument
    java.io.IOException: Invalid argument
    at sun.nio.ch.FileChannelImpl.lock0(Native Method)
    at sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:528)
    at java.nio.channels.FileChannel.tryLock(FileChannel.java:967)
    at TestFileLock.writeLogFile(TestFileLock.java:43)
    at TestFileLock.main(TestFileLock.java:23)
    on a intel linux box, java 1.4 and this code works fine:
    import java.io.*;
    import java.nio.channels.*;
    import java.util.*;
    public class TestFileLock
         private static File file;
         private static RandomAccessFile fileRandom;
         private static FileChannel fileChannel;
         private static FileLock fileLock;
         private static String process;
         public static void main(String[] args)
              process = args[0];
              try
                   file = new File("/home/fauxn/work/blast/java/java_blast/test.log");
                   //fileWriter = new FileWriter(file, true);
                   fileRandom = new RandomAccessFile(file, "rw");
                   fileChannel = fileRandom.getChannel();
                   for(int i =0; i < 1000; i++)
                        writeLogFile(process + ": happy days\n");
              catch(Exception exception)
                   System.out.println(exception.getMessage());
                   exception.printStackTrace();
         * Method lockes the logFile and then append the string to
    * the file and unlocks the file.
         private static void writeLogFile(String s) throws IOException
         System.out.println(process + ": trying to lock the log file");
         fileLock = fileChannel.tryLock(0, fileRandom.length(), false);
         while(fileLock == null)
                   System.out.println(s + ": waiting!!!!");
                   fileLock = fileChannel.tryLock(0, fileRandom.length(), false);
         System.out.println(s + ": logfile locked");
         fileRandom.seek(fileRandom.length());
         fileRandom.write(s.getBytes());
         fileLock.release();
         System.out.println(s + ": logfile unlocked");
    Any suggestions welcome, or is this a bug????
    Thanks in advance :)

    Its a known bug. The default tryLock() method calls the parametered
    tryLock method as follows
    tryLock(0,Long.MAX_VALUE,false);unfortunately under linux the parameter Long.MAX_VALUE is too big for
    the underlying OS file locking. This causes the IOException to be thrown
    It has been fixed in version 1.4.1 i believe.
    For more info
    http://developer.java.sun.com/developer/bugParade/bugs/4532474.html
    matfud

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

  • File locked message when saving a file with Photoshop

    We've been seeing a problem with several users that is hard to reproduce. Every once in a while when they try to save a file in Photoshop on the server they get a dialogue saying 'the file is locked, use Finder info to unlock the file'.
    This file is located on the server and the problem only happens when doing a 'Save', not with a 'Save as'. The server is running 10.5.5 and the clients are 10.4.11. This is happening with Photoshop versions CS1, 2 and 3. It also happend with Illustrator CS3 once.
    We've been experimenting with different scenario's using different ACL's and POSIX settings. Also, when the client reboots their machine the exact same 'Save' actions works again.

    I've been receiving complaints about a similar issue over the past few weeks, except using Quark and Excel. I wonder if it's related to the 10.5.5 update. Are you sure you didn't get the version numbers reversed in your post? We're having the issue with 10.4.11 SERVER and 10.5.5. CLIENTS.
    It's a file locking issue, so you probably won't fix it by changing the ACLs or POSIX permissions. The server thinks a different process still has the file open, so it's preventing you from changing the file. "Save As" works because it creates a new file.
    You can probably eject & reconnect the volume from the client instead of fully rebooting.
    The question is what's keeping the file open. You can run:
    sudo lsof | grep <filename>
    ... in Terminal to see whether a given Mac has the file open. If the server comes back with a response to that command (don't worry what it says - you just want to see if anything comes back), then you know that the file is locked.
    Next, go to each client that could have the file open and run the same command. If none of them have it open, you're probably looking at the same glitch that I've been. The server thinks a file is open but none of the clients do.

  • 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

  • [Acrobat X Pro] File locks and page counts when printing

    Hi,
    We have two users on Acrobat X Pro Win 7 X32.
    On both systems they have the following issues.
    1) If they were to print only page 1 for example, they can set a page count of 5 copies and it would be fine. If later on they were to print page 10 and they would also like 5 copies, the page count has reverted to the default 1 copy. It doesn't remember the selection of 5 copies from the previous print.
    Is this a bug?
    2) File locks occur on all files even if they are specifically closed. The file lock is only removed once they close Acrobat down entirely. This has cause alot of problems. Has Adobe acknowledged this as a fault yet?
    Thanks.

    Make sure the Preview panel in Windows Explorer is disabled.

  • File Lock with NFS cache

    I use the API FileChannel.lock() to get the file lock for gobal lock based on NFS system, I know that many operations on the NFS system are not atomic because of system cache, but I also know the NFS system has its own lock mechanism, so I don't know if the API FileChannel.lock() is safe as the global lock, which accessed by processes from different nodes.
    OS Linux 2.6.16.60-0.21-smp
    NFS server v3
    NFS Client v3

    Crossposted and answered.

  • File Locking!!! Is this a BUG or there is something wrong in my code.

    In new JDK v 1.4. new means of file locking are introuced, and it seems it is a little bit buggy yet (or maybe this one isn't a one). though it's better than nothing :)
    here is 2 classes. first locks a file, the second attemts to change it.
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    class FileLocker {
      static File targetFile = new File ("D:\\Java",
                                         "manual.chm");
      public static void main(String[] args)
          throws Exception
        RandomAccessFile fin = new RandomAccessFile (targetFile, "rw");
        FileChannel fChan = fin.getChannel();
        FileLock lock = fChan.lock();
        // to let other process to attempt to change the same file.
        Thread.currentThread().sleep(100000);
        lock.release();
        fChan.close();
        fin.close();
    }and the other class
    import java.io.*;
    import java.nio.*;
    import java.nio.channels.*;
    class FileWriter {
      static File targetFile = new File ("D:\\Java",
                                         "manual.chm");
      public static void main(String[] args)
          throws Exception
        // this is better/more secure way to access files.
        RandomAccessFile f = new RandomAccessFile (targetFile, "rw");
        // next line deletes the file content even if file locked.
    //    FileOutputStream f = new FileOutputStream (targetFile);
    //--this parts is not needed as the problem is in first 2 lines
        FileChannel fChan = f.getChannel();
        if (fChan.isOpen()) {
          System.out.println("File is Opened, can't write");
        } else
          f.write(-1);
    }so when i use FileInputStream for open stream to write,
    constructor deletes the targetFile (makes it size equal to 0)
    at once i create new FileInputStream object. Since, when i
    use RandomAccessFile to open stream for writting nothing happens.
    after that, f.write (-1); throws exception regardless the way the
    uoutput stream was created.
    So i think there is some problem in FileInputStream class' constructor.

    OK, I know you mean FileOutputStream instead of FileInputStream in the above message. Looks to me like you've discovered a bug in the way Java is locking the file - locking the whole contents of a file (using the no-args lock or tryLock methods) doesn't prevent other programs, including Java, from overwriting some, if not all, of the file. Note that this occurs even on Windows 2000, where exclusive locks appear to be well supported.
    I've found a similar problem where saving from Outlook appears to zero the whole of the locked file. Saving from other programs that are a little more careful, such as XEmacs, appears to only (!) truncate the file to 0, as the FileOutputStream does.
    From what I can tell, in JDK 1.4.2 RandomAccessFiles respect each others' locks, but nothing else does.

  • 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

  • Why is this file locked (man chflags), does it need to be, and is it safe to unlock it?

    Why is this file locked (man chflags), does it need to be, and is it safe to unlock it?
    ~/Library/Application Support/Adobe/Enterprise/Resources/Resource_3_1.db
    Type this into a terminal in OS X, the above file appears to have a flag set to lock.
    x-man-page://chflags

    <the-sound-of-crickets>
    The reason I'm asking, we have a bunch of computers we inherited that have some permissions issues within each user's respective home directory ("~"). The issue effects Acrobat Pro X's ability to launch ("Internal error occurred") since it tries to get access files/folders it doesn't have access to when the user launches. Recursively setting ownership to the respective user fixes the problem (and follows Apple's guidelines). However, that one file appears to have the unix file lock set (man chflags). So we are using a pre-installation script on our push policy to loop through every home directory. It appears the above file is the only one that won't let us change permissions.
    Don

Maybe you are looking for