[fpc-pascal] Access GPIO pins on RPi2 without root?

2015-10-07 Thread Bo Berglund
How can one control the GPIO outputs on a Raspberry Pi2 without needing the program to run as root? I am using Raspbian Wheezy and I need to add two relays controls to my program. The pages I have found with google are for the original Pi so the connector referenced is the wrong size and it is

Re: [fpc-pascal] Access GPIO pins on RPi2 without root?

2015-10-07 Thread leledumbo
>How can one control the GPIO outputs on a Raspberry Pi2 without needing the program to run as root? sudo chown root sudo chmod 4755 The 4 is setuid bit, which will allow normal users to run the program but the program itself has root privilege. -- View this message in context:

Re: [fpc-pascal] Access GPIO pins on RPi2 without root?

2015-10-07 Thread Lukasz Sokol
On 07/10/15 08:02, Bo Berglund wrote: > How can one control the GPIO outputs on a Raspberry Pi2 without > needing the program to run as root? I am using Raspbian Wheezy and I > need to add two relays controls to my program. > The pages I have found with google are for the original Pi so the >

Re: [fpc-pascal] Access GPIO pins on RPi2 without root?

2015-10-07 Thread Jonas Maebe
Bo Berglund wrote on Wed, 07 Oct 2015: How can one control the GPIO outputs on a Raspberry Pi2 without needing the program to run as root? I am using Raspbian Wheezy and I need to add two relays controls to my program. This really has nothing to do with either FPC or Pascal programming in

Re: [fpc-pascal] PostgreSQL notifications broken

2015-10-07 Thread Mark Morgan Lloyd
Mark Morgan Lloyd wrote: Michael Van Canneyt wrote: On Mon, 28 Sep 2015, Mark Morgan Lloyd wrote: PostgreSQL has a useful feature where application programs can send notifications to each other, this tends to be much "cheaper" than periodically polling a table for changes. I've had this

Re: [fpc-pascal] Access GPIO pins on RPi2 without root?

2015-10-07 Thread Michael Van Canneyt
On Wed, 7 Oct 2015, Mark Morgan Lloyd wrote: Jonas Maebe wrote: Bo Berglund wrote on Wed, 07 Oct 2015: I think that it really does because there must be some interface between the FPC system and the underlying operating system managing the hardware. On Linux/Unix, every interface to

Re: [fpc-pascal] Access GPIO pins on RPi2 without root?

2015-10-07 Thread Mark Morgan Lloyd
Jonas Maebe wrote: Bo Berglund wrote on Wed, 07 Oct 2015: I think that it really does because there must be some interface between the FPC system and the underlying operating system managing the hardware. On Linux/Unix, every interface to hardware gets exposed as a file (generally under

[fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Graeme Geldenhuys
Hi, I need to compress a file the same way as PHP's gzcompress() function: http://php.net/manual/en/function.gzcompress.php >From that URL it uses ZLIB, and that is apparently different to GZIP and DEFLATE, because PHP also has a gzencode() and gzdeflate() functions respectively. It seems

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Graeme Geldenhuys
On 2015-10-07 16:51, Dmitry Boyarintsev wrote: > The difference is mentioned in deflateInit2() functions, where a user can > specify windowBits. If the value is negative, to Gzip header would be > generated. > > I presume the gzcompress is passing negative value to the function, while > gzencode

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread silvioprog
On Wed, Oct 7, 2015 at 12:26 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > Hi, > > I need to compress a file the same way as PHP's gzcompress() function: > >http://php.net/manual/en/function.gzcompress.php-pascal >

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Graeme Geldenhuys
On 2015-10-07 16:56, Graeme Geldenhuys wrote: > constructor has an option ASkipHeaders which defaults to False. I'm now > setting that parameter to True and will soon see if that works for my > code or not. That didn't work for my experiment. :-/ Regards, - Graeme - -- fpGUI Toolkit - a

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Dmitry Boyarintsev
Not sure about, if there's an equivalent function, but the difference with Gzip and Deflate is the following. Gzip contains an information about the original file + deflate (compressed) stream of data. Default is just stream of data. For example ZIP files are using Deflate, but not using Gzip

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread Graeme Geldenhuys
On 2015-10-07 17:22, Graeme Geldenhuys wrote: >> > constructor has an option ASkipHeaders which defaults to False. I'm now >> > setting that parameter to True and will soon see if that works for my >> > code or not. > That didn't work for my experiment. :-/ Correction, I made a silly mistake in

Re: [fpc-pascal] How to duplicate PHP's gzcompress() function in FPC?

2015-10-07 Thread silvioprog
On Wed, Oct 7, 2015 at 1:42 PM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: [...] > Correction, I made a silly mistake in my code. I've managed to get it to > work with TCompressionStream and with ASkipHeaders = False (the default). The link that I sent has a nice explanation (and