Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Can I Move a File That is Still Being Written to?

Primary Software: LabVIEW Modules>>Real-Time Module
Primary Software Version: N/A
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
When I try to move a file that is being written to, the file will be moved with the data acquired before the move.  The write operations do not yield errors even though nothing is being written.  This file might become a lost cluster, recoverable with a Win98 boot disk that has the SCANDISK or CHKDSK utilities.  How do I get around this?

Solution:
Do not try to move a file unless you know that it is complete. Otherwise there may be undesired effects on the file system.  This can be done by naming and re-naming the file, by a global variable acting as a mutex, or other blocking mechanisms. The best choice is to close the file, then add the filename to a FIFO. Another loop can read the FIFO to find the latest file that is allowed to be moved.

Related Links:

Attachments:

 



collisionForce.vimake unique name.viFILE0011.CHK


Report Date: 05/14/2007
Last Updated: 08/13/2007
Document ID: 491EFRKI

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit