01-25-2017 10:32 AM
I'm not sure if this is old hat, but it was the cause of some recent frustration on my part. I was creating several thousand files based on common stock names, when my previously working program started to hang suddenly, at apparently the same point. The running LV 2014 VI never recovers, the Stop button becomes non-functional and I have to kill it via the Windows Task Manager. It turns out a new name, "PRN" came up in the database I was using to create these new files from. Investigating, I attemped to manually create the file, which resulted in my Windows 7 Professional system indicating "The Specified Device Name is Invalid". Investigating the Windows error, I found on line that "Windows cannot create a file or folder named any of these keywords : CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, and LPT9". Probing on the diagram, I find the Open/Create/Replace File executes without output error - just LV hangs indefinitely when it tries to create the file named PRN.
So, what are the chances anyone (but me) is going to create a file using these particular names? Still, I think LV 2014 should have handled it in a better way. Of course, I dont know if a later version of LV fixes this "hang" from happening. Hope this helps someone here.
Whomever "PRN" is, they're going to be glad they picked that ticker... On the flip side, all Windows users creating stock ticker named files are going to remember them!
01-25-2017 10:46 AM
I'm in Labview 2012 and if I try to create a file called PRN, it doesn't hang but immediately outputs error code 1.
01-26-2017 08:20 AM - edited 01-26-2017 08:28 AM
Hi,
**EDIT: I should have read the first post more, but I can also confirm that LabVIEW 2016 throws Error 1 instead of hanging. It seems that later versions of LabVIEW at least handle the error instead of freezing up like your LabVIEW 2012 code is. **
This actually is a problem with Windows, heralding back from DOS 1.0. There are certain filenames that are reserved in Windows, and you actually can't create any type of file with that name. I just tried right-clicking on my desktop and creating a text file called "PRN.txt" and Windows threw an error, and will throw an error if you try to use any of the other "reserved" filenames as well.
Here's a list of Windows-reserved names that you can't use at all:
Source: http://stackoverflow.com/questions/122400/what-are-reserved-filenames-for-various-platforms
01-26-2017 08:26 AM
@Jorr-El wrote:
Hi,
This actually is a problem with Windows, heralding back from DOS 1.0. There are certain filenames that are reserved in Windows, and you actually can't create any type of file with that name. I just tried right-clicking on my desktop and creating a text file called "PRN.txt" and Windows threw an error, and will throw an error if you try to use any of the other "reserved" filenames as well.
Here's a list of Windows-reserved names that you can't use at all:
- com1,
- com2,
- ...
- com9,
- lpt1,
- lpt2,
- ...
- lpt9,
- con,
- nul,
- prn
Source: http://stackoverflow.com/questions/122400/what-are-reserved-filenames-for-various-platforms
Right. And the OP did mention that in the above post. But the fact that the code didn't output an error is strange to me because when I create a file called PRN, it does output an error code.
01-27-2017 03:54 PM
...Which is a lot different than "The running LV 2014 VI never recovers, the Stop button becomes non-functional and I have to kill it via the Windows Task Manager." Glad to read your version (2012) works.
01-29-2017 11:25 PM
I have LV Home edition 2014 and it throws an error 1 when trying to create a file named "PRN".