* * *

Author Topic: "File Not Found" message on file that *does* exist  (Read 3469 times)

hayanninja

  • New member
  • *
  • Posts: 45
"File Not Found" message on file that *does* exist
« on: January 13, 2018, 01:11:07 am »
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

  • Hero Member
  • *****
  • Posts: 2610
  • My goal: build my own game engine using Lazarus
Re: "File Not Found" message on file that *does* exist
« Reply #1 on: January 13, 2018, 08:35:06 am »
I can reproduce it on Lazarus 1.8.0 64-bit Gtk2 on Ubuntu Mate 17.10.

Handoko

  • Hero Member
  • *****
  • Posts: 2610
  • My goal: build my own game engine using Lazarus
Re: "File Not Found" message on file that *does* exist
« Reply #2 on: January 13, 2018, 08:40:43 am »
But sometimes I got different message:
« Last Edit: January 13, 2018, 08:43:43 am by Handoko »

howardpc

  • Hero Member
  • *****
  • Posts: 2782
Re: "File Not Found" message on file that *does* exist
« Reply #3 on: January 13, 2018, 11:14:35 am »
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

  • Hero Member
  • *****
  • Posts: 2345
Re: "File Not Found" message on file that *does* exist
« Reply #4 on: January 13, 2018, 11:29:36 am »
@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.

howardpc

  • Hero Member
  • *****
  • Posts: 2782
Re: "File Not Found" message on file that *does* exist
« Reply #5 on: January 13, 2018, 11:37:32 am »
@molly

Forbidding behaviour is guaranteed to get a certain type of person to behave that way just for the hell of it.
But you are probably right. And a patch to change how the IDE reacts to this sort of back door file manipulation would probably be accepted.
I shan't be the one to waste time on producing such a patch, however.

You know the story of the man who was found banging his head against a wall? "Why are you doing that?" he was asked.
"Because it is such a relief when I stop" he replied.

Thaddy

  • Hero Member
  • *****
  • Posts: 6923
Re: "File Not Found" message on file that *does* exist
« Reply #6 on: January 13, 2018, 11:39:28 am »
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.
You actually missed lpi files and these are likely the cause imo. Lazarus wants to turn everything into a project. It also demands read/write access even if instructed to compile to somewhere else.
Ada's daddy wrote this:"Fools are my theme, let satire be my song."

molly

  • Hero Member
  • *****
  • Posts: 2345
Re: "File Not Found" message on file that *does* exist
« Reply #7 on: January 13, 2018, 11:44:58 am »
@howardpc:
Walls and heads, yes  :)

Perhaps i did not express myself corectly in my previous post. I couldn't care if it was to be supported or not,but when not then at least prevent the user from doing so.

e.g. User error: trying to open a file while project is open.... or better yet, ignore the new invocation altogether.

In most luxurious case:  Lazarus - you are trying to open a .pas file while you have a project open, what do you want to do:
1) close project, open .pas
2) ignore this .pas file.
2a) add this .pas file to project
3) quit lazarus
4) browse the internet
5) play pong

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 809
    • Burdjia
Re: "File Not Found" message on file that *does* exist
« Reply #8 on: January 13, 2018, 01:35:16 pm »
Curious. I had a similar behaviour yesterday on Windows XP SP3.  Not latest Lazarus IIRC (I don't have that computer here now, but I think it is the latest 1.6 release).  It happened only once so I didn't worried about it.
« Last Edit: January 13, 2018, 01:37:25 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

ASerge

  • Hero Member
  • *****
  • Posts: 945
Re: "File Not Found" message on file that *does* exist
« Reply #9 on: January 13, 2018, 04:28:50 pm »
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.
Windows 7 64 bit, NTFS partition, Lazarus 1.8.0
Reproduced, but only if the following conditions are met:
1. The project must at least once be compiled.
2. The length of the name without extension is less than 4 characters.

Bart

  • Hero Member
  • *****
  • Posts: 3115
    • Bart en Mariska's Webstek
Re: "File Not Found" message on file that *does* exist
« Reply #10 on: January 13, 2018, 05:43:27 pm »
A similar bug when dragging a file onto Lazarus exists and is reported in the bugtracker somewhere.

Bart

Bart

  • Hero Member
  • *****
  • Posts: 3115
    • Bart en Mariska's Webstek
Re: "File Not Found" message on file that *does* exist
« Reply #11 on: January 13, 2018, 05:55:47 pm »
See Issue #28154.
It may be related.

Bart

hayanninja

  • New member
  • *
  • Posts: 45
Re: "File Not Found" message on file that *does* exist
« Reply #12 on: January 15, 2018, 04:54:45 am »
Looks like the same issue to me, the only difference is it's triggered by opening the file from Windows Explorer rather than by drag-and-drop.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus