LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create file saving directory structure

I want to save files to a directory structure such as this:
D:\MDC_BCCA\study#\Raw_Data\barcode\mmddyy\filename.png
where study#, barcode & mmddyy are variables from the rest of the program. 
I may have several files saving to the same study # & barcode.
I have been using Build Path and New Directory but I get an error 10: Duplicate path when I run the program more than once.

How can I set the permissions & group in New Directory so I don't get the error  or is there a better way to do this?

Thanks.
0 Kudos
Message 1 of 3
(2,856 Views)

I think the Create Directory Recursive.vi that is available in vi.lib\utility\libraryn.llb will help you.  This VI will create a folder on disk, and if necessary, will also create any parent folders of that folder that do not yet exist.  If the entire folder hierarchy that you are attempting to create exists, then this VI is essentially a no-op.  You can look at the diagram of this VI if you would prefer to write this yourself, but need help knowing what File I/O functions to use, and what parameters to specify on those functions.

Good luck,

-D

0 Kudos
Message 2 of 3
(2,854 Views)

Hi Darren,

The vi was exactly what I was looking for.  Thank you! 

S
0 Kudos
Message 3 of 3
(2,835 Views)