File Locking and LabVIEW

I am writing a bunch of data to a file from a LabVIEW VI. I am
using the standard file I/O routines. I would like to view this
file with another program while LabVIEW is running -- this is
no problem with programs that open the file for reading only, but
most programs attempt to open it with write-permissions as well
which fails under Windows95. Is there a way I can tell LabVIEW
to relax all locking on the file itself so that I can view it with
wordpad or others?
Andrew Berkley
Department of Physics
University of Maryland

In article <[email protected]>,
Greg McKaskle wrote:
>> I am writing a bunch of data to a file from a LabVIEW VI. I am
>> using the standard file I/O routines. I would like to view this
>> file with another program while LabVIEW is running -- this is
>> no problem with programs that open the file for reading only, but
>> most programs attempt to open it with write-permissions as well
>> which fails under Windows95. Is there a way I can tell LabVIEW
>> to relax all locking on the file itself so that I can view it with
>> wordpad or others?
>
>In LV you can look at changing the Deny Mode setting on the file
>Open function. You may also want to use this in conjunction with
>the Range Locking if you do allow the other a
pp to modify the file.
>Both of these are in the File I/O > Advanced Palette, and you will
>need to turn on the Detailed Diagram Help in the Help window to get
>more information on the parameters.
The default deny mode is to allow all other users to read/write the file.
Somehow it still doesn't work. I open the file with the advanced open VI
and leave the deny mode unwired (which should allow all other users to access
the file) and still when I start up wordpad or word it complains that the file
is in use. Any ideas? The real reason for this is that it would be nice to
run an ftp server on the machine so I can check the data files from elsewhere
as labview is running. The FTP server cannot open the files for the same
reason as word or wordpad, etc.
Andrew

Similar Messages

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

  • File Locking and Renaming

    I have multiple processes that scan the same directory for files. Once a process sees a file, I want it to lock ,rename the file and release the lock. I get the file to lock, but I cannot figure out how to rename it. The normal File object renameTo methods don't seem to work once the file is locked.
       File  _file = new  File("c:\\test\\abc123.txt");
       RandomAccessFile _raf = new RandomAccessFile(_file, "rw");
       Channel  _Channel = _raf.getChannel();
       Lock  _fl = _Channel.lock();
       _file.renameTo(new File("c:\\test\\abc123.001"));
       _fl.release();
        _raf.close();Many thanks in advance for help!

    Why don't u use a simple file copy. In this alternative way you will just need to copy the file before locking it:
    import java.io.*;
    import java.nio.channels.*;
    public class FileTest {
      public FileTest() throws FileNotFoundException, IOException {
        File  _file = new  File("c:\\test\\abc123.txt");   
        File _file2 = new File("c:\\test\\abc123.001");
        copyFile(_file,_file2);   
        RandomAccessFile _raf = new RandomAccessFile(_file, "rw");  
        FileChannel  _Channel = _raf.getChannel();  
        FileLock  _fl = _Channel.lock();   
        //_file.renameTo(_file2);  
        _fl.release();
        _raf.close();
      public static boolean copyFile(File source, File target)
        try {
          FileInputStream in = new FileInputStream(source);
          FileOutputStream out = new FileOutputStream(target);
          BufferedInputStream in_buf = new BufferedInputStream(in, 8192);
          BufferedOutputStream out_buf = new BufferedOutputStream(out, 8192);
          byte buf[] = new byte[1024];
          int lens;
          while((lens = in_buf.read(buf)) > 0)
              out_buf.write(buf, 0, lens);
          in_buf.close();
          in.close();
          out_buf.close();     
        catch (Exception ex) {
        ex.printStackTrace();
          return false;
        return true;
      public static void main(String[] args) {
        try {
          FileTest fileTest1 = new FileTest();
        catch (FileNotFoundException ex) {
          ex.printStackTrace();
        catch (IOException ex) {
          ex.printStackTrace();
    }Do you need file lock for another purpose?

  • File locking and shell script

    Hi,
    with Mac OS X is there a file locking system to prevent file to be copyied or move to a folder B before they are completely copyied in folder A ?
    Regards

    The files in folder A are created by a program like
    Pitstop
    My question was : what can happen if a file in folder
    A is not complitely created and the shell script
    attempt to copy it ?
    In general, if the shell script attempts to copy a file before the creator is finished writing to it, the shell script will copy the part of the file that's already present, so the copy will be incomplete. The creating application can prevent that (by writing to a temporary file and changing the name of the file only after it's finished writing, or by making the file readable only after it's done), but that's up to the application.

  • Files locks and permissions

    Hi,
    I've just started a new job and taken over a Mac Pro. I've been given a new login as an admin but i've got problems saving files etc. everytime i come to a folder i haven't touched i only have read permissions so i can't re-save files, or save new ones in these folders. So at the moment i'm having to keep going to 'get info' clicking the lock at the bottom, entering the password. and allowing admin to Read and Write so that i can save files.
    To be more specific it says this in the 'sharing and permissions':
    Edit 1 (not me) - Read and Write
    admin (is me including) - read only
    everyone - Ready only
    I'm getting slightly annoyed with this, is there someway to give me full read and write access straight away or am i going to be click the blooming lock icon forever?
    Thanks
    Mark
    Message was edited by: mglenister
    Message was edited by: mglenister

    First move any important data/files from the old user's home folder to /Users/Shared. Then make a new user account for yourself in System Preferences -> Accounts. You will have to get your system administrator to do this for you if you don't know the admin password. Log in and use the new, fresh account. You will have read-only access to the files in /Users/Shared. Do a Command-D on the files to make new copies of them, with correct permissions so you can edit them.
    Reinstalling everything is still important; make sure you do it at the earliest opportunity.

  • File Locked and Unable to to Rename?

    Hi,
    I have been doing some work on a Uni Windows computer and copied the file I was working on to a USB. I have opened it on my mac only to find that it shows it has a small silver padlock on the file while open in the finder window. I have tried rename it and cannot but it seems to open just fine. In the "get info" window permission says "Read Only" but alongside the user names and the administrators user name it says "Read and Write." Can anyone help me and explain how I maybe able to unlock it as I need to rename this file?
    Many Thanks
    Matt

    The USB drive is formatted as NTFS. It can be read, but not natively written, on a Mac. If you want to drive to be both readable and writable on both platforms, it should be formatted as FAT32. To do that, you have to back up and erase it.

  • File VBX and Labview

    Can Labwiew use a file VBX ?
    So yes how ??
    Thank you
    Laurent

    > Can Labwiew use a file VBX ?
    > So yes how ??
    >
    LV can use OCXes, but not VBXes. More specifically, LV
    can use ActiveX controls and servers through their automation
    interface. By this time, I'd hope that most useful controls
    and servers would be available as OCXes.
    Greg McKaskle

  • File locking over AFP for GnuPG?

    I'm trying to get Network Home directories working for our company as we have a few hotseat MacMini's and don't want to have local profiles on each. I've got that working as expected, the issue I'm having now is that we use GnuPG quite extensively and I can't get it to work over the network share. After a bit of digging it looks like it need to lock the key files while they're being accessed.
    The error I'm seeing is:
    gpg: lock not made: link() failed: Operation not supported
    gpg: can't lock `/Network/Servers/macmini-server.local/Volumes/UserData/Network Users/testuser/.gnupg/secring.gpg'
    gpg: DBG: Oops, `/Network/Servers/macmini-server.local/Volumes/UserData/Network Users/testuser/.gnupg/secring.gpg.lock' is not locked
    gpg: keyblock resource `/Network/Servers/macmini-server.local/Volumes/UserData/Network Users/testuser/.gnupg/secring.gpg': General error
    I know about the 'lock-never' option for GnuPG, but that doesn't work when setting a new key, and isn't the ideal solution.
    Is there an option on the AFP server that needs to be set to enable locking?
    Steve

    I am sure Apple provide a means to do file locking and/or record locking. However your software might need to be written to properly call Apple's APIs to do this. I know Microsoft as an example always (tried) to do this their own way and as a result it pretty much never worked properly with Office for Mac.
    This sort of query is going to be better pursued via Apple's Developer forums.

  • Why am I being told that a JPEG file that I made changes to in Photoshop 6 (CS6) can't be saved?  The message I get says that either the file is locked and I don't have permission to execute this or another program is using this file.

    i recently purchased a 21.5 iMac with Yosemite (10.10.1) and was disappointed to discover that my CS6 programs are not functioning correctly.  I am unable to use the "Save As" command  when making changes to a JPEG file in Photoshop.  The message I get says that either another program is using the file or it is locked and I don't have permission to execute that command.  I'm experiencing a similar problem in Bridge when trying to move an unwanted file to the Trash.  Again, I get a message telling me that i don't have permission to do this.  Lastly, I'm unable to open any Camera Raw files.  Any suggestions?  I had no problems with the Mavericks OS on my old iMac and although it's much slower, I'm tempted to go back to using my old iMac.  At this point, I feel as if I've just wasted $2300+ (tax included). 

    Back up all data before proceeding.
    This procedure will unlock all your user files (not system files) and reset their ownership, permissions, and access controls to the default. If you've intentionally set special values for those attributes on any of your files, they will be reverted. In that case, either stop here, or be prepared to recreate the settings if necessary. Do so only after verifying that those settings didn't cause the problem. If none of this is meaningful to you, you don't need to worry about it, but you do need to follow the instructions below.
    Step 1
    If you have more than one user, and the one in question is not an administrator, then go to Step 2.
    Triple-click anywhere in the following line on this page to select it:
    sudo find ~ $TMPDIR.. -exec chflags -h nouchg,nouappnd,noschg,nosappnd {} + -exec chown -h $UID {} + -exec chmod +rw {} + -exec chmod -h -N {} + -type d -exec chmod -h +x {} + 2>&-
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the built-in Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Paste into the Terminal window by pressing command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    You'll be prompted for your login password, which won't be displayed when you type it. Type carefully and then press return. You may get a one-time warning to be careful. If you don’t have a login password, you’ll need to set one before you can run the command. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator.
    The command may take several minutes to run, depending on how many files you have. Wait for a new line ending in a dollar sign ($) to appear, then quit Terminal.
    Step 2 (optional)
    Take this step only if you have trouble with Step 1, if you prefer not to take it, or if it doesn't solve the problem.
    Start up in Recovery mode. When the OS X Utilities screen appears, select
              Utilities ▹ Terminal
    from the menu bar. A Terminal window will open. In that window, type this:
    resetp
    Press the tab key. The partial command you typed will automatically be completed to this:
    resetpassword
    Press return. A Reset Password window will open. You’re not going to reset a password.
    Select your startup volume ("Macintosh HD," unless you gave it a different name) if not already selected.
    Select your username from the menu labeled Select the user account if not already selected.
    Under Reset Home Directory Permissions and ACLs, click the Reset button.
    Select
               ▹ Restart
    from the menu bar.

  • How do I select multiple files under "Get File Info"and lock or unlock all?

    How do I select multiple files under "Get File Info"and lock or unlock them all? It seems to do it automatically when I have 10 or more selected. But how do I lock or unlock 5 or 6 files in one swoop? Thanks

    Select the desired files then press OPTION and select Show Inspector from the Finder's File menu.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • 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 Lock - How to lock and unlock a file ? Can we do that for an FTP File?

    Hi All,
    I like to retrieve a file from the FTP server using Apache Commons Net libraries.
    for example if the file size is 20MB. When the file is in the progress of copying or transferring from the FTP server i need to lock the local file which is in our local directory so that no other process will use the same local file which is in the process of copying otherwise partially copied files will be used by another process.
    the file should be locked when it was in the progress of copying from the server. I have an automatic process which will access file objects at certain time and try to process the files.
    I like to know the simplest and easiest way to lock and unlock a file object locally which is trying to copy a file from the FTP server which is of huge size.
    And also i like to know how to lock and unlock a file in general?
    Thanks,
    J.Kathir

    we can set it read only only when it complete finishing the writing.
    can we able to make the file as read-only while transferring data to file.
    How to achieve it ? pls give me some sample code

  • Time Machine backup file corrupted and locked

    This morning when I switch on my Mac there was a dialogue box telling me that my Time Machine backup file was corrupted and that Time Machine would have to create a new backup file.
    I am backing up my Macs to a disk connected to my Airport Extreme. It's been working for months without any problems. Other than this morning. Time Machine buddy had the following message:
    +Starting standard backup+
    +Attempting to mount network destination using URL: afp://[email protected]/MyBookHome+
    +Mounted network destination using URL: afp://[email protected]/MyBookHome+
    +QUICKCHECK ONLY; FILESYSTEM DIRTY+
    +Runtime corruption detected on /Volumes/MyBookHome/iMac27.sparsebundle (fsck_hfs -q termination status: 3)+
    +Attempting to mount network destination using URL: afp://[email protected]/MyBookHome+
    +Mounted network destination using URL: afp://[email protected]/MyBookHome+
    +Backup verification failed for image /Volumes/MyBookHome-2/iMac27.sparsebundle!+
    +Moved previous backup image to /Volumes/MyBookHome-2/iMac27_2010-11-01-032949.sparsebundle+
    +Recovery backup declined by user.+
    +Backup canceled.+
    +Ejected Time Machine network volume.+
    Has anybody seen something like this before?
    I now have a locked and renamed sparsebundle on my disk and backups are not working anymore.

    aschmid wrote:
    Yes you are right, I know it isn't supported - as so many other things but they work!
    This one is notorious for working for a while, then . . . not.
    In addition to the problems above I got a pop-up from Time Machine saying the backup file is broken and it needs to create a new one. I told it to go ahead and what happened is that it actually proceeded to DELETE the old backup file before creating a new one - there goes my several months of backup history!
    Yes, just as it says in the message. See #C13 in [Time Machine - Troubleshooting|http://web.me.com/pondini/Time_Machine/Troubleshooting.html] (or use the link in *User Tips* at the top of this forum).
    All I can say do now is connect my drive directly to my iMac and figure out a way how I can backup my other iMac and the MacBook I have. On the AE this just worked remotely.
    Yeah. Until it didn't.
    Really not much options here to backup a home with 3 Macs!?!
    Sure there is. Back the others up to the same drive, over your network, via sharing. See #22 in [Time Machine - Frequently Asked Questions|http://web.me.com/pondini/Time_Machine/FAQ.html] (or use the link in *User Tips* at the top of this forum), for details and setup instructions.

  • My iTunes itl file is locked and its not letting me in my itunes at all

    my itunes is locked and i cant get in

    I received the same locked error just now on OSX, and even holding down Option when launching didn't do the trick.  I ended up having to follow the instructions here which was essentially:
    Drag your iTunes Library.itl file from your iTunes folder onto your desktop
    Launch iTunes, the library will be blank
    Quit iTunes, and copy the iTunes Library.itl file back from the desktop into your iTunes folder (it will warn you that you are replacing the newer blank file, that's fine)
    Restart iTunes
    This did the trick for me though still not sure why it happened in the first place!

Maybe you are looking for

  • Error installing NetWeaver Develepor Studio

    Hi all, While installing Developer Workplace an error occured. Error Details: Java Runtime Version: 1.4.2_09 Java Home Directory: C:\Program Files\Java\j2re1.4.2_09 Phase 19: Create Secure Store ERROR 2007-01-12 17:44:56 CJS-30050 Cannot create the s

  • Saving a report with two  query providers into .csv format

    Hi, I have developed a webi report which has two query providers. I have linked the objects from these two queries at the report level using merged dimensions. the report is running fine. When I save it in EXCEL or PDF it saves the same report, but w

  • Java files from a EAR file

    I want to read all Java files from a EAR file and from inner (inside EAR) EAR or WAR file with out unpacking. suppose "Demo.ear" contaions the following files: abc.java programs / a.java programs / b.java src / index.java src / com / myFolder / main.

  • Smartview for Office 11.1.2 and Office 2010 (64 bit)

    Hi to all, does anyone have some experiences if Smart View for Office works with Office 2010 in an 64bit environment? I know this is not yet officially supported, but what could be possible issues? Regards Uli

  • Error: Table /1FB/MD___M8006P error in DDIC - Check table with SE14

    Hi Friends, I've a problem related to the activation table, if I want to activated always problematic because there are fields POSITION, there are errors like this view : Activation of worklist (MST.EKA / 15.04.2011 / 11:20:59 /) ====================