NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
querty999
Posts: 69
0 Kudos

How to rename project (.prj) and workspace (.cws) files?

CVI lets me rename a project in the programming environment (Edit -> Project) but the name of the project file on disk (.prj) doesn't change. Is there a way to change the project file name?

 

I want to do the same thing for the workspace file (.cws). How?

 

thanks!

Trusted Enthusiast
RobertoBozzolo
Posts: 4,572
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?

There actually isn't an option to allow renaming prj and cws files: as they are simple text files, for small projects  you can handle them manually with a text editor and simple OS functions.

However, there is an idea posted in the LabWindows/CVI Idea Exchange that suggests the addition of a "Save as development distribution" function, that could help you in this respect. Feel free to kudos that idea and / or comment on it to add your opinions and wishes.




Using LW/CVI from 3.1 on.

My contributions to the Developer Zone Community
________________________________________
If I have helped you, why not giving a kudos?
Member
querty999
Posts: 69
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?

Thanks Roberto. At least I can stop looking in the CVI environment for a solution.

 

As a novice CVI programmer I use the CVI examples a lot. Sometimes I even use the example code as a starting point for my own code. But I haven't found a clean way to move the examples to another folder. I think I may have actually modified some of the example code before I figured out what was happening. Not good!

 

Sometimes I want to open a random C file so I can copy and paste code into my program. But the CVI environment wants to make that random C file part of the project, I believe. If I recall correctly, it even changes my default folder to the location of the random C file. Very frustrating!

 

Oh well, I guess that's just the way it is. Seems like a major omission to me.

 

thanks!

Trusted Enthusiast
RobertoBozzolo
Posts: 4,572
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?


querty999 ha scritto:

Sometimes I want to open a random C file so I can copy and paste code into my program. But the CVI environment wants to make that random C file part of the project, I believe. If I recall correctly, it even changes my default folder to the location of the random C file. Very frustrating!


The highlighted sentence is not true: you can open any number of source files in the editor without having them added to the project; the same happens for include files and for any text file you want. The CVI environment will remember you have those files open and will try to open them again the next time you run it, but they won't be included in the compilation and won't be part of your application / project.




Using LW/CVI from 3.1 on.

My contributions to the Developer Zone Community
________________________________________
If I have helped you, why not giving a kudos?
Active Participant
ebalci
Posts: 584
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?

 

CVI would ask you to add an external C file to your project only if you try to compile it.

 

S. Eren BALCI
www.aselsan.com.tr
Trusted Enthusiast
RobertoBozzolo
Posts: 4,572
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?

 


ebalci ha scritto:

 

CVI would ask you to add an external C file to your project only if you try to compile it.

 


...but only if you are actually calling functions in that C file, if I'm not wrong!

 




Using LW/CVI from 3.1 on.

My contributions to the Developer Zone Community
________________________________________
If I have helped you, why not giving a kudos?
Member
querty999
Posts: 69
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?

Roberto,

 

Thanks for correcting my mistake. Unfortunately it it throws me back into a state of confusion. I thought I had isolated what causes CVI sessions to switch folders. But now I don't know what does it. All I know is that sometimes when working in CVI I find files being saved and opened in a folder other than the one I started in.

 

Anyway, it's a relatively minor irritation in an otherwise wonderful application. I'll just have to pay more attention.

 

The workspace/project thing is the most confusing concept in the CVI programming environment. I've wondered if CVI is designed work like MS Visual Studio. That way it would be familiar to VS programmers. But prior to CVI I'd never used VS or any other IDE so it's all foreignd to me.

Trusted Enthusiast
RobertoBozzolo
Posts: 4,572
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?

I have never observed that CVI changes the location of a file while working in the IDE. It may happen that if you mode a project or part of it to another folder it tries to fix paths for files that can no more be located in the project folder: this event is normally evidenced by a warning message when you open CVI.

 

In any case, clicking in the project tree area and selecting View >> Show full pathnames menu option you can see the exact location where project files are stored: in case a path is wrong you will need to save a copy of the mislocated file to the correct location, unload it from the project and reload the correct one.




Using LW/CVI from 3.1 on.

My contributions to the Developer Zone Community
________________________________________
If I have helped you, why not giving a kudos?
Active Participant
lvrat
Posts: 247
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?

I am trying to rename the exsisting project and files on dias. As the post mention

"as they are simple text files, for small projects  you can handle them manually with a text editor and simple OS functions"

What OS functions are being referred?

I have a large project and need to rename the files on disk. Started with creating a new project and workspace but now has a lot of Project link errors - undefined symbols?


*************************************************
CLD,CTD
*************************************************
Active Participant
lvrat
Posts: 247
0 Kudos

Rif.: How to rename project (.prj) and workspace (.cws) files?

Fixed, need to load the instruments - thanks!

*************************************************
CLD,CTD
*************************************************
By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page