I created this text file last night within Geany, edited it without any issues. Closed it. This morning when I try to open it from within Dolphin File Manager it opens Geany but there is just a blank tab on Geany. The file is 6.8KiB. I can right-click (within Dolphin File Manager) the file and 'open with' using mousepad text editor and it opens fine. Can see all the text.
The error reported within the 'status' area of Geany is:
`10:35:56: Could not open file /home/user1/Documents/forums/yyy/test/test file incorrect (Error when getting information for file “/home/user1/Documents/forums/yyy/test/test file incorrect”: No such file or directory)`
There is not enough information to help you, which OS version of Geany etc. Note that the error message is the system error message from the file open, it is not Geany's message so the system open can't find the file.
Can `cat` read the file? Is the file local to your machine, mousepad may handle remote mounting? Can `cat` and Geany read the file while it is open in mousepad?
It turned out I had a 'LF' (carriage return) at the end of the file name (possibly in the directory named 'test' too). So, 'test file 'LF' which was causing the unusual behaviour on Geany.
I tend to write the heading of the note (file) within geany, copy that, then save the file with the copied text as the filename. Must have copied the carriage return too. Odd that mousepad handles carriage returns on filenames but Geany doesn't or at least doesn't give a more descriptive error message. The only way I stumbled across it was by copying the directory name then trying to paste it within thunar file manager (thinking it's something to do with dolphin) then thunar showed the carriage return. Renamed the directory by removing the carriage return. THen when I did tried to rename the file, thunar showed the carriage return on the file too. Renamed by removing the carriage return. Now opens fine in Geany.
Please fix Geany so it opens the files with carriage returns (mistakenly added) when naming files or at least provide a more descriptive error.
It sounds like you had Geany open and then opened the file in the file manager?
If so, does it open from the file manager if all Geanys are closed first?
It sounds like you had Geany open and then opened the file in the file manager?
How do you mean?
If so, does it open from the file manager if all Geanys are closed first?
No. It wouldn't open from file manager when all Geany instances are closed (In only have one Geany instance open).
BTW, do you not think the carriage return in the folder and/or filename was the cause(s). If not, why not? How come the issue is now fixed, now that I've removed the carriage returns?
No. It wouldn't open from file manager when all Geany instances are closed (I only have one Geany instance open).
I mean _all_ Geany instances should be closed, I want you to try so the file manager starts Geany, not that it opens a tab in an existing instance.
No. It wouldn't open from file manager when all Geany instances are closed (I only have one Geany instance open).
I mean _all_ Geany instances should be closed, I want you to try so the file manager starts Geany, not that it opens a tab in an existing instance.
I presume this is just for troubleshooting purposes?
Because you can't really ask the user to close Geany and open it through clicking on the offending file through the file manager every time s(he) wants to open that file. For a start s(he) will need to be aware of the issue, otherwise clicking on it while Geany is open will bring up the 'save file' endless loop. That's a rabbit hold we all wanna stay clear of.
Anyway, how come the issue doesn't affect mousepad?
For troubleshooting purposes, I've exited Geany completely, then clicked the test file with carriage return at the end of the file name. It opened Geany without any hitches. See attached screenshot. Still disconcerting that it's an issue when Geany is open. ![text-file-with-carriage-return-in-file-name-opened-direct-through-file-manager-when-no-instances-of-geany-running--](https://user-images.githubusercontent.com/24494120/183617843-4ef24226-b6c8-4...)
I've exited Geany completely, then clicked the test file with carriage return at the end of the file name. It opened Geany without any hitches.
This confirms that the problem is in the protocol that transfers the filename to an existing instance so it opens in a tab. This is a line oriented protocol, as described [here](https://github.com/geany/geany/blob/master/src/socket.c), so a line feed in the filename will terminate the filename early.
Filenames should never have non-printing characters in them deliberately, this is a known spoofing mechanism[^1]. So such filenames should only ever happen accidentally, as in your case, and so be rare.
It would require a re-engineering of the protocol to fix, and is only likely to happen if somebody provided a well written pull request with the changes.
Just a note, contributors may not have a system capable of reproducing the problem immediately available, so you are asked to try things. So please do not try to attribute intentions to people trying to help you as in "I presume this is just for troubleshooting purposes? Because you can't really ask the user to close Geany and open it through clicking on the offending file through the file manager every time s(he) wants to open that file". Just concentrate on providing the requested information.
[^1]: the filename one sees on the screen and the actual filename are different, as you experienced until you realised the problem, so in some ways its better to _not_ open such names, but Geany would not want to get into enforcing such limitations on filenames
Hello,
Filenames should never have non-printing characters in them deliberately, this is a known spoofing mechanism1. So such filenames should only ever happen accidentally, as in your case, and so be rare.
If and when it happens accidentally, the application should not leave the user with a system where s(he) has to kill the process in order to use the program again. The application could have a mechanism to catch the error and/mistake by the user and offer options to solve it or better still handle it gracefully. e.g. as mousepad does.
Just a note, contributors may not have a system capable of reproducing the problem immediately available, so you are asked to try things.
You may need to provide the user with the reason(s) as to how come you are asking a user to do something. Otherwise, they may not bother getting back to you (especially with a case like mine where the solution or workaround became apparent to me soon afterwards). Note that I've used up my precious resources to provide you with particulars including a screenshot when I could've simply ignored your response (and email). At least be grateful for that. It'll be a good starting point to keep friendly relations with the user base. It's not like there aren't any other free notepad applications out there. So, it's not that we are stuck with using your application. Kindly take note of that.
where s(he) has to kill the process in order to use the program again.
Your edit to the [comment](https://github.com/geany/geany/issues/3245#issuecomment-1208967926) was missed, probably would have been better as another comment so it stood out, and github does not mail edits.
I don't understand the sequence of actions you took, if the file didn't open, why does Geany want you to save the file? Clearly something is missing. Please provide an exact set of steps to reproduce, please use the command line as only a few contributors are likely to have the file manager you are using, and may not have it configured the same as you, so we have no idea what command it is running and how it is running it.
In an earlier post you said ` 'LF' (carriage return)`, those are different characters, LF (newline) code 0x0A and CR (carriage return) code 0x0D, please confirm which you used.
At least be grateful for that.
Every contributor to Geany is a volunteer, all of us give our own time to provide those contributions, so please be grateful for that.
It's not like there aren't any other free notepad applications out there. So, it's not that we are stuck with using your application. Kindly take note of that.
Whilst I rarely agree with Richard Stallman (except I am also a grumpy olde guy), he said it best about volunteer open source projects on the emacs ML "We make the software because we want to. We are not in competition with other applications for market share. We make it available for others to use in the hope that they may find it useful, not because we gain from their use, in fact it costs us time to help them with their issues. If others find the software useful we are happy for them, if they do not find it useful we are sad for them, but we do not lose anything if they do not continue to use our software."
github-comments@lists.geany.org