News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

How to change .h and .cpp file name while in editor

Started by Chay Hawk, September 04, 2013, 04:32:04 AM

Previous topic - Next topic

Chay Hawk

Hi i have been using code blocks for a while and i was wondering if there was a way to change the file name in the editor because i named some oddly and i want to change them and i dont want to delete the file. I have never had any need for multiple files up until now so i am not familiar with a method to change their names.

ToApolytoXaos

#1

  • Open your project that is located in your Workspace. No source file should be open in editor btw.
  • Go to the file that is located on your Project > Sources (for .cpp files) or to Headers (for .h / .hpp files)
  • Right click on the file and choose "Rename file..."

That's it.

bangorme

I'm having some real problems with the naming of files within a project and organizing them.  For example, in my project I have a "main" template where int main() goes.  I want to rename it.  So I follow the directions here and close the file, right click the "main" file, rename it.  Instead of  just  renaming it, C::B creates a virtual folder and puts the file in there.  Unfortunately,  C::B doesn't treat files there  like regular files and basically turns into notepad.  So, I try to rename it back to "main", and it doesn't move back into the project srv folder, but still sits in the virtual folder.  So, I go into file manager and manually move it into the correct folder, restart C::B, and C::B moves it right back into the virtual folder.  There it sits.   So, I'm wondering if there exists a clear explanation for how C::B handles files, (specifically renaming, project folders, virtual folders, C::B treatment of files in virtual folders, etc) because this is a recurring problem with other files I've created.  Any help would be appreciated.

Thanks


O.S. Fedora
Ver: SVN 9844

stahta01

Quote from: bangorme on July 16, 2014, 01:46:51 AM

SNIP

O.S. Fedora
Ver: SVN 9844

Any Fedora or other Linux users able to duplicate this problem?
On Windows 7 32 bit, I do NOT see this issue with self built SVN Trunk ( wx2.8 ).

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

BlueHazzard

You have to add a extension, like .cpp or .h to your file...

greetings

[Edit:] c::b use the extension to differentiate between the files and move them in the right directory...