Jump to content

Creating new files and folders wont work


m3nth

Recommended Posts

Hi there,

I'm all new to the labView programming "language" and i have a problem.

For my internship I'm creating a program and I'm having a problem creating files and folders.

When I run the program from the labView programming enviroment it creates the files and folders perfectly.

I compiled the program with the Application Builder and i ran it again. Then it says that it cant find the specified file and/or folder. It does that because it cant create it, but i dont know why.

Is someone familiar with this problem and can you please help me?

Link to comment
When I run the program from the labView programming enviroment it creates the files and folders perfectly.

I compiled the program with the Application Builder and i ran it again. Then it says that it cant find the specified file and/or folder. It does that because it cant create it, but i dont know why.

You are probably using the Current VI's Path constant to build a path to the file or folder you want to create. This constant's value is actually not so constant in that it is different in a build executable.

Say your VI is normally located in c:\app\main.vi and you build an exe in c:\app\build\main.exe.

In the first case, the constant's value will be c:\app\main.vi in the second case it will be c:\app\build\main.exe\main.vi

So in the case of an executable you'll need to strip of one more path element to find the application directory.

If you have the OpenG libs installed, you can use the Current VI's Parent Directory VI instead of the Current VI's Path constant. It will figure out if it's running from an exe or dev.environment automatically for you.

Or you can do it yourself by looking at the Application.Kind property.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.