Chapter 2Extensions to LabVIEW© National Instruments Corporation2-39LabVIEW LEGO MINDSTORMS NXT ModuleFile HandlesYou must open a handle to a file before you can use read or write methods on the file. The NXTFileOpenRead, NXTFileOpenWrite, or NXTFileOpenAppend methods return a unique handle value. The NXT firmware also automatically registers open handles in an internal table such that the NXTResolveHandle system call method can look up any open handle by filename.You must close each file handle with the NXTFileClose method before using the file to which it refers for any other purpose. When a program ends, the NXT firmware automatically closes any handles left open by the program.NoteWhen NXT firmware 1.26 or later automatically closes a file, the firmware removes all unused space to maximize free space on the device.The NXT firmware restricts the maximum number of concurrently open file handles to 16. Note that running programs uses up one file handle, and any current sound playback or other background process can take up additional file handles. In practice, a program can generally open 10–12 handles, but opening that many handles is fairly rare.