Forum > Suggestions

"File Not Found" message on file that *does* exist

(1/3) > >>

hayanninja:
Windows 10 64-bit, NTFS partition, Lazarus 1.8.0.

Steps to reproduce:
1. Have a project open in Lazarus.
2. Manually create (via the OS, not Lazarus) a new .pas file. May need to be inside the project folder or at least a subfolder thereof, not sure. Your OS must be configured to open pas files in Lazarus. (I would assume this still happens with other extensions too.)
3. Double-click this file, to open it in Lazarus.
4. Lazarus will claim that the file does not exist when trying to open it and ask if you'd like to create it.
5. If you say "No", then try to open it a second time, it opens properly.

I have Mac and Linux installations of Lazarus too but have not tested if the bug also occurs there.

Handoko:
I can reproduce it on Lazarus 1.8.0 64-bit Gtk2 on Ubuntu Mate 17.10.

Handoko:
But sometimes I got different message:

howardpc:
I suppose technically this behaviour is a bug.
However, it is hardly worth bothering with, since it only appears when a developer abuses the IDE.

Lazarus, in the nature of things, closely manages all .lpr, .pas, .pp, .lfm, .inc files and the like in the current project. This is required for the tight integration between the Designer, Object Inspector and Editor.
It is not unreasonable  for the IDE to assume that when you want a new file you will use File->New unit or File->New form (or File->New...) so that the IDE itself initiates creation of the new file, and is not just presented with an operating system novelty that you have forced into existence by some back door approach.

molly:
@howardpc:

Isn't it so that it is lazarus 'choice' to only invoke one instance. And to accept parameters, opening a file (in existing or freshly launched instance) if that would to be the case. If so, isn't it so that it is lazarus choice to 'open' a file when another project is open ?

I agree that it is a OS 'backdoor', but one that is conveniently used/supported/implemented by Lazarus, so also the consequences of implementing that the correct way even if the user shouldn't do it. I haven't seen this advertised as 'forbidden' in the Lazarus manuals.

2 cents.

Navigation

[0] Message Index

[#] Next page

Go to full version