Recent

Author Topic: Problem with symlink file  (Read 5020 times)

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Problem with symlink file
« on: July 23, 2017, 10:03:11 pm »
Hello, I am writing a utility which amongst other things extracts lines from a .pas file and writes them to a new .pas file with a related file name.

My test app has preferencesunit.pas as the source file name and it generates preferencesunit_methodgroup.pas.

Previously, due to a coding error, I was generating a file called preferencesunit_methodGroup.pas (note the capital G). I have since deleted all traces (I think) of this errant file name.

However, when I come to open the new file in Lazarus I get the error shown below. What's going on?
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: Problem with symlink file
« Reply #1 on: July 23, 2017, 10:06:51 pm »
Probably same thing I already answered today: screwed lpi. Save everything, delete lpi in terminal and open the LPR. That will have the pton to create new project or even do it automatically.
Specialize a type, not a var.

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Problem with symlink file
« Reply #2 on: July 23, 2017, 10:08:00 pm »
However, when I come to open the new file in Lazarus I get the error shown below. What's going on?

See if that really is a symlink. In Terminal, ls -l will list files with enough detail. If it's a symlink, you'll see that it points to the file with the upper case letter (->).


Thaddy

  • Hero Member
  • *****
  • Posts: 14157
  • Probably until I exterminate Putin.
Re: Problem with symlink file
« Reply #3 on: July 23, 2017, 10:10:17 pm »
That's also an option, but note lpi files are case-insensitive for unit names etc afaik. If you do cross-platform work, that often fails.
Specialize a type, not a var.

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Problem with symlink file
« Reply #4 on: July 23, 2017, 10:17:10 pm »
I closed then reopened Lazarus again and opened the file preferencesunit_methodgroup.pas. It didn't give me any message this time but in the Lazarus open file display, it's still showing as preferencesunit_methodGroup.pas (see attached image). It doesn't really matter, I guess, it's just offending my sense of order!
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Problem with symlink file
« Reply #5 on: July 23, 2017, 10:18:57 pm »
I should say, Thaddy, that the .lpi haven't been touched for a couple of days, so I don't think that's it.
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Problem with symlink file
« Reply #6 on: July 23, 2017, 10:24:35 pm »
It's nothing to do with the contents of preferencesunit_methodgroup.pas either - it consists purely of a bunch of comment lines, no unit name or anything like that.
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Problem with symlink file
« Reply #7 on: July 23, 2017, 11:47:16 pm »
The only files part of a project that contain filenames are the .lpi and .lps file.

That you haven't touched the file for a couple of days... well, that's the culprit, isn't it ? It seems to still  contain the old 'wrong' filename otherwise you would not be confronted with the error.

Is it perhaps too difficult to delete those two files ? Usually opening a command prompt and issuing a command like "delete filename" does the job.

It doesn't bother lazarus one bit, that you delete those two files. As long as you leave your .pas and .lpr files alone (and form files plus resources) then Lazarus will always be able to load your project.

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Problem with symlink file
« Reply #8 on: July 24, 2017, 01:59:48 am »
The only files part of a project that contain filenames are the .lpi and .lps file.

That you haven't touched the file for a couple of days... well, that's the culprit, isn't it ? It seems to still  contain the old 'wrong' filename otherwise you would not be confronted with the error.

Given that the generation of the code happened yesterday afternoon and the project files I was referring to predate this by several days, the logic of that falls down somewhat, no?

As it turns out the filename was being held in an .lps but not one which I had mentioned or that you could have any way of knowing about. I deleted the .lps (my 20+ years of Delphi experience, not to mention the previous 8 years of DOS experience, gave me the necessary expertise to do that!)

Is it perhaps too difficult to delete those two files ? Usually opening a command prompt and issuing a command like "delete filename" does the job.

"Patronising? Moi?"
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Problem with symlink file
« Reply #9 on: July 24, 2017, 04:18:15 pm »
Given that the generation of the code happened yesterday afternoon and the project files I was referring to predate this by several days, the logic of that falls down somewhat, no?
fwiw, i was talking about the .lps/.lpi files and not the files with the actual code contents.

I do not know about you but i have no (exact) knowledge about Lazarus deciding when and how the contents of these files are refreshed.

What i do know are the symptoms you described and that these stem from a .lps/lpi with out of sync contents, as per Thaddy's answer.

Quote
"Patronising? Moi?"
Hardly. I'm merely adjusting my answer(s) based on given reponse(s).

carl_caulkett

  • Sr. Member
  • ****
  • Posts: 306
Re: Problem with symlink file
« Reply #10 on: July 24, 2017, 05:56:25 pm »
Given that the generation of the code happened yesterday afternoon and the project files I was referring to predate this by several days, the logic of that falls down somewhat, no?
fwiw, i was talking about the .lps/.lpi files and not the files with the actual code contents.
I was talking about the .lps/.lpi files as well.

You had no logical basis on which to say:
That you haven't touched the file for a couple of days... well, that's the culprit, isn't it ? It seems to still  contain the old 'wrong' filename otherwise you would not be confronted with the error.

I accept that you are correct in saying that the symptoms are typical of out of sync .lps/.lpi files, but that doesn't excuse the tone or logic of your "that's the culprit, isn't it?" comment.

Quote
Quote
"Patronising? Moi?"
Hardly. I'm merely adjusting my answer(s) based on given reponse(s).
At the risk of being accused of being patronising myself, you might want to re-examine the comment:
Quote
Is it perhaps too difficult to delete those two files ? Usually opening a command prompt and issuing a command like "delete filename" does the job.

and reflect on how insulting that came across.

Look, I'm not trying to pick a fight or anything and I recognise that you are one of the more knowledgeable regulars here, but without the benefit of non-verbal communication to aid the conveyance of tone and mood, you really need to be careful about how comments come across.

Cheers,
Carl
« Last Edit: July 24, 2017, 06:00:11 pm by carl_caulkett »
"It builds... ship it!"

Mac Mini M1
macOS 13.6 Ventura
Lazarus 2.2.6 (release version)
FPC 3.2.2 (release version)

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: Problem with symlink file
« Reply #11 on: July 24, 2017, 08:14:59 pm »
Quote
Probably same thing I already answered today: screwed lpi.
No respone, interpreted as ignoring advise.

Quote
I should say, Thaddy, that the .lpi haven't been touched for a couple of days, so I don't think that's it.
Making up your own logic, meant to justify ignoring given advice.

Quote
It's nothing to do with the contents of preferencesunit_methodgroup.pas either - it consists purely of a bunch of comment lines, no unit name or anything like that.
Still not looking at the mentioned files, interpreted as ignoring given advice.

Quote
You had no logical basis on which to say:
The above quotes do not provide me with a logical base for that particular response from my hands ?

Are there any words you are able/willing to spend on attempting to make that statement stick ?

My question if it is perhaps too difficult to delete those files, was a genuine question. Because advice was not followed i assumed that you perhaps did not know how to delete a file. At the most the words were used to sparkle your fire  :)

Quote
Look, I'm not trying to pick a fight or anything and I recognise that you are one of the more knowledgeable regulars here, but without the benefit of non-verbal communication to aid the conveyance of tone and mood, you really need to be careful about how comments come across.
imo your written words can only be interpreted as ignoring given advice, making up your own logic and that you are left with the same issue that you started out with.

So, when you write:
Quote
...and reflect on how insulting that came across.
.... you perhaps might want to take the opportunity to reflect on your own response (or lack thereof)...

In case you are looking for velvet gloves, then you are addressing the wrong person. On boards where i usually post, your thread would have been closed/removed right from the first post for lack of providing required information.

You do not have to apologize or be careful for addressing me in person, as you are (as everyone else is) entitled on your own opinion. You also have the freedom to ignore my ramblings (as i apparently and in hindsight should have done with yours)

That you sugarcoat yourself, doesn't change your actions. The correct action (from your hands) could apparently only be invoked by writing what i wrote.

In the end: you got the issue fixed now, or not ? Perhaps you prefer(ed) the silent treatment instead ?

 

TinyPortal © 2005-2018