Author Topic: How to change .h and .cpp file name while in editor  (Read 11164 times)

Offline Chay Hawk

  • Multiple posting newcomer
  • *
  • Posts: 21
How to change .h and .cpp file name while in editor
« on: September 04, 2013, 04:32:04 am »
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

  • Guest
Re: How to change .h and .cpp file name while in editor
« Reply #1 on: September 04, 2013, 07:36:16 am »
  • 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.
« Last Edit: September 04, 2013, 07:37:58 am by ToApolytoXaos »

Offline bangorme

  • Multiple posting newcomer
  • *
  • Posts: 28
Re: How to change .h and .cpp file name while in editor
« Reply #2 on: July 16, 2014, 01:46:51 am »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: How to change .h and .cpp file name while in editor
« Reply #3 on: July 16, 2014, 02:06:45 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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to change .h and .cpp file name while in editor
« Reply #4 on: July 16, 2014, 02:09:38 am »
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...