Author Topic: cannot open files  (Read 17944 times)

Offline thunderben

  • Single posting newcomer
  • *
  • Posts: 5
cannot open files
« on: October 01, 2016, 01:52:55 pm »
Hi all,

my conf is: Fedora 24 x86 + code::blocks 16.01

While my previous conf (fedora23-x86 + code;;blocks 12.??) worked perfectly well, since my recent update I'm not able to open any kind of file (.c, .h, .txt either).

I found nothing on the web....

Any idea to allonw me developing with this IDE ?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: cannot open files
« Reply #1 on: October 01, 2016, 02:00:14 pm »
What do you mean by cannot open file?
Please post the exact steps to reproduce the problem!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline thunderben

  • Single posting newcomer
  • *
  • Posts: 5
Re: cannot open files
« Reply #2 on: December 26, 2016, 10:10:11 am »
Back on this issue.

Well by "cannot open file", I mean:
1) from menu "Files -> Open -> [select a text fle]" and then clic on "OK"
2) clic on "open" icon from Main toolbar, and then select a text file
3) from project frame (yes, I'm able to open workspace), right clic on a source file and select "open <filename>"

After one of theses operations, nothing occur. file does not show off

Please notes:
- , if I run procedure 3) and select sub menu "open with --> hex edior" , file is opening correctly as expected.
- by "text file" I mean a file generated by gedit, or vi. displayed type by command "file <filename>" is "ASCII text"

Regards
« Last Edit: December 26, 2016, 10:13:17 am by thunderben »

Offline CJS

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: cannot open files
« Reply #3 on: December 26, 2016, 12:05:54 pm »
Files that aren't automatically handled by Code::Blocks are handled according to extension, as set up in Menu-->Settings/Environment/Environment Settings dialog
Select the "File Extension Handling" icon on the left. On the right should be a list of registered wildcards.  For example, *.txt.  If the file you want to open is not a standard Code::Blocks type handled internally it needs to be listed here.  Use the "New" button to add the extension if it is not listed.

There are 3 options to open files:
  • Launch an external program - a user-defined program will start.  If adding new, you need to find the relevant program using the "External Program" /"Select Program" dialog.
  • Launch the associated application - Windows opens the applications assigned for the file extension in Windows
  • Open it in a Code::Blocks editor - self explanatory.
On General Settings there is a "Manage" button which opens a dialog with checkboxes to select which files are associated by extension with Code::Blocks, these should typically be project files, workspace files, source code, and header files.

See also: How to auto open files with an external program? http://forums.codeblocks.org/index.php?topic=11873.0

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: cannot open files
« Reply #4 on: December 27, 2016, 04:26:40 pm »
what if you create new file/project?

Offline thunderben

  • Single posting newcomer
  • *
  • Posts: 5
Re: cannot open files
« Reply #5 on: December 29, 2016, 10:43:34 am »
First: thanks for your answers.

CJS:
It have nothing to do with file extension: even ".c" and ".h" files do not open.
Nevertheless, I followed your directives: ".c" files are set to be opened by codeblocks editor.
Plus, I changed ".txt" files association with an external editor (gedit). This operation works well, txt files are now edited with gedit while I open them from codeblocks.

BlueHazzard:
I'm able to edit created file with codeblocks just after creation. BUT, if i close them and try to re-edit them, they don't open as others files.

An intuition:
It feel like internal editor did not installed correctly.

Please note I installed codeblocks from Fedora24 repository via yum extender (graphical interface from yum)


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: cannot open files
« Reply #6 on: December 29, 2016, 11:11:36 am »
An intuition:
It feel like internal editor did not installed correctly.
The editor is inseparable part form codeblocks.

I guess it is time to record a video showing us what is going on.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cannot open files
« Reply #7 on: December 29, 2016, 12:05:10 pm »
Can you start codeblocks from a console with the -v parameter (and probably the -d also) to get some debug information ?
Nevertheless, I will install Code::Blocks in a fresh F24 VM to see if I can reproduce the error.
Where are your files located by the way ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7591
    • My Best Post
Re: cannot open files
« Reply #8 on: December 29, 2016, 12:55:49 pm »
An intuition:
It feel like internal editor did not installed correctly.
The editor is inseparable part form codeblocks.

I guess it is time to record a video showing us what is going on.

I have no idea what happens if the default MIME handler is turn off.
But, it might match the OP problem.

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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cannot open files
« Reply #9 on: December 29, 2016, 12:57:45 pm »
Works fine here, on a clean vm with a fresh install of C::B.
All files uptodate.

What's the output if you run
Code
dnf list codeblocks*
in a console ?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cannot open files
« Reply #10 on: December 29, 2016, 01:02:50 pm »
An intuition:
It feel like internal editor did not installed correctly.
The editor is inseparable part form codeblocks.

I guess it is time to record a video showing us what is going on.

I have no idea what happens if the default MIME handler is turn off.
But, it might match the OP problem.

Tim S.
It shows an error message (e.g.):
Quote
Could not open file /home/jens/test.txt,
because no extension handler could be found.
(just tried on F24).
*.cpp files still open flawlessly.

Offline thunderben

  • Single posting newcomer
  • *
  • Posts: 5
Re: cannot open files
« Reply #11 on: December 30, 2016, 02:52:18 pm »
ISSUE SOLVED!

jens
1)
Your question: "Where are your files located by the way ?" remind me troubles when I developed on Windows. VisualStudio had limitation on projects files path...

My source path was: "/home/benoit/Documents/C\C++/Hello"
BacsSlash seems suspicious, so I turned it to a minus, so here my new path: "/home/benoit/Documents/C-C++/Hello".

And abracadabra, file opening works perfectly now :)
It official: C:B don't like backslashes !!!!!!!

2)
nevertheless, I ran C:B from a console with -d and -v (with faulty file path) and re-try issue.
I had no debug message on console screen, nor I found log file. Do you know where to find it (them) ?

ANYWAY

many thanks to all for your precious help

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cannot open files
« Reply #12 on: December 30, 2016, 03:01:18 pm »
-v pops up a window for some special problems, -d add a "Code::Blocks debug"-tab to "Logs & others".

Offline thunderben

  • Single posting newcomer
  • *
  • Posts: 5
Re: cannot open files
« Reply #13 on: December 31, 2016, 12:52:14 pm »
Thanks Jens.

I attached a file with a copy/paste of "code:blocks" and "code:blocks debug" tabs.

Have a nice reading ;)

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: cannot open files
« Reply #14 on: December 31, 2016, 01:19:36 pm »
I see the issue here too.
The problem is, that the backslash is an allowed character in Unix/Linux filenames, but space seperator in windows.
C::B converts all backslashes in filenames to "normal" forward slashes on save of the projectfile.
That can be called a bug on Linux, but I don't know if a fix is worth the work.

Using charactares, that are only allowed on one platform, lead to problems problems for cross-platform developping and a fix might introduce new bugs.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: cannot open files
« Reply #15 on: January 02, 2017, 04:17:23 pm »
We should at least report this as a warning/error, so the users know what is going on.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]