Recent

Author Topic: Lazarus can't write to files when building  (Read 1454 times)

geraldholdsworth

  • Full Member
  • ***
  • Posts: 195
Lazarus can't write to files when building
« on: January 17, 2021, 03:04:20 pm »
Hi all, me (the pain/Linux newbie) again...

New problem - someone has asked me for an ARM Linux binary of one of my projects. So, I set about installing Raspbian on my RPi 2, then Lazarus. I then managed to compile my project and produce a binary for them...happy days.

OK, here is the issue - I had to copy the project across using a USB stick, and then it wouldn't run the executable from the stick (a Linux issue, I believe)...that's fine, I just copied the project to the system drive and tried again - success.

However, doing it this way is a bit of a pain, so I've set my RPi up, headless, and am VNCing in from my Mac. I've got a shared folder of the projects and I get Lazarus to open this directly. When it comes to running, it fails with the error unable to write the RES file. Is this another Linux permission thing, or a MacOS permission thing, or a funny with Lazarus?

I can write to the shared folder, from Raspbian, fine. The permissions given on the MacOS side allow reading and writing for all users. So it is just this file it can't do (if I select a release build, it also can't write the LPR file).

Thanks in advance.

Gerald.

geraldholdsworth

  • Full Member
  • ***
  • Posts: 195
Re: Lazarus can't write to files when building
« Reply #1 on: January 17, 2021, 03:17:43 pm »
OK, I was looking at the wrong file...it was set for Read Only, so I've changed it. Didn't make any difference as Lazarus still can't write to these files.

So, I rebooted the Pi and now it won't connect to the shared folder at all!!!

Best to just ignore me for now...it does look like a permissions thing.

EDIT: This is confusing - it seems that Lazarus creates a new file (LPR file) but then can't write to it, resulting in a blank file and my LPR code missing (glad I've got a backup). The RES file...not sure what is happening there. But, I can read and write to the share without any issues (create new file, edit using Text Editor, then save).
« Last Edit: January 17, 2021, 06:38:35 pm by geraldholdsworth »

geraldholdsworth

  • Full Member
  • ***
  • Posts: 195
Re: Lazarus can't write to files when building
« Reply #2 on: January 19, 2021, 12:19:43 pm »
For completeness (and in case anyone else has the issue), I've found out how to get this working:
Code: Bash  [Select][+][-]
  1. mkdir /home/pi/Whatever
  2.  
  3. sudo mount.cifs //192.168.0.XYZ/MYHOMEDIRONTHEMAC /home/pi/Whatever -o username=MYUSERNAME,password=MYPASSWORD,uid=pi,gid=pi
  4.  

Assuming you're using the default Raspberry Pi username of 'pi'.

Gerald.

 

TinyPortal © 2005-2018