Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread Boris Samorodov
On Thu, 7 Oct 2010 16:00:31 -0700 Brian Winfrey wrote: > Here are the modifications I made in exploring this issue: It works on: - % uname -a FreeBSD host.ipt.ru 9.0-CURRENT FreeBSD 9.0-CURRENT #3 r213198M: Mon Sep 27 15:43:54 MSD 2010 b...@host.ipt.ru:/usr/obj/usr/src/sys/HOST i386 ---

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Matt Emson
Sent from my iPhone On 7 Oct 2010, at 22:44, Michael Van Canneyt wrote: > >> Aren't there automation systems for this? Just like debian's 'apt-get update >> && upgrade' with a custom repository with your software? But then for >> windows I presume? > > I haven't seen any yet. The main prob

Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread Brian Winfrey
I don't know if you noticed, but it appears that code has some depracated properties that should be changed. Here are the modifications I made in exploring this issue: program GetPrimaryIpAddress; {$mode objfpc} uses baseunix, unixtype, sockets, SysUtils; procedure Get(out AddrOut: stri

Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread Brian Winfrey
I think you want to use 127.0.0.1 to return the actual address. In my case I would const CN_GDNS_ADDR = '127.0.0.1'; run the progarm and the output would be 192.168.1.5 as long as there is an active interface. On Thu, Oct 7, 2010 at 3:34 PM, silvioprog wrote: > Hi Brian, > I tested again, an

Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread silvioprog
Hi Brian, I tested again, and discovered that's not is necessary a connection to a web. I changed to 0.0.0.0 and returned 127.0.0.1, perfect! :) I will use this function. Thanks very much again. :) 2010/10/7 Brian Winfrey > >> On 06/10/10 14:27, Felipe Monteiro de Carvalho wrote: > >>> Ok, tha

Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread Brian Winfrey
>> On 06/10/10 14:27, Felipe Monteiro de Carvalho wrote: >>> Ok, thanks everyone, it seams that I managed to extract a function >>> from Silvio's code which doesn't use Synapse. I only tested in Windows >>> so far: >>> >>> unit chesstcputils; >>> >>> {$mode objfpc}{$H+} >>> >>> interface >>> >>> us

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Micha Nelissen
Michael Van Canneyt wrote: I haven't seen any yet. The main problem is that the update isn't 'optional' or 'to be scheduled at X every night'. It must be done when the server application says it is time to do so. apt-proxy ... push to the proxy when it's time to update stuff ;) Micha

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Michael Van Canneyt
On Thu, 7 Oct 2010, Micha Nelissen wrote: Michael Van Canneyt wrote: Yes, but if the administrator must update 20 PCs manually every 2 weeks, he quickly complains that he has better things to do, so it must be done when the 'ordinary' user uses the application. Aren't there automation syste

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Micha Nelissen
Michael Van Canneyt wrote: Yes, but if the administrator must update 20 PCs manually every 2 weeks, he quickly complains that he has better things to do, so it must be done when the 'ordinary' user uses the application. Aren't there automation systems for this? Just like debian's 'apt-get upda

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Jonathan
On Thu, 07 Oct 2010 11:01:44 +0200 Sven Barth wrote: > Btw: What are Tomoyo and Apparmour (I can imagine what the second one > is, but I don't know what functionality they provide)? http://tomoyo.sourceforge.jp/ https://wiki.ubuntu.com/AppArmor ___ fp

Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread Frank Church
I am developing for an embedded system and found out that 'nmap --iflist' does a faily good job of this if the output is examined and parsed properly. If it is suitable and you can possibly extract the code (if you are prepared to go that far) it might help you. It is also cross platform On 7 Octo

Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread silvioprog
2010/10/7 Luca Olivetti > > I didn't try it, but I see that it tries to connect to google's dns server, > so it'd fail miserably if the computer has no internet access. > > Bye > -- > Luca > I tested, without web access does not work. :o -- Silvio Clécio, *programmer* *ObjectPascal* __

[fpc-pascal] lNet getting the local IP

2010-10-07 Thread bwCode4U
Choose a different address that would not fail in a specific situation. For example, one could read their /etc/resolve file to get the dns server. Brian Winfrey ~~ Important Note: Code provide as an example. There could be errors or risks in using it. There is no warranty implied or imp

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Sven Barth
Am 07.10.2010 14:41, schrieb Michael Van Canneyt: Well, in schools the administrator is a teacher (usually maths or so) who gets the additional job of managing the schools' IT structure. And all our clients are schools. Schools are indeed a bit special... sometimes you have to be lucky if the

Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread Luca Olivetti
En/na Marco van de Voort ha escrit: In our previous episode, Brian Winfrey said: I found an example for linux on stack overflow that was in c http://stackoverflow.com/questions/212528/linux-c-get-the-ip-address-of-local-computer Compiles on FreeBSD and the result looks sane (but on a system

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Michael Van Canneyt
On Thu, 7 Oct 2010, Sven Barth wrote: Am 07.10.2010 14:21, schrieb Michael Van Canneyt: On Thu, 7 Oct 2010, Sven Barth wrote: Am 07.10.2010 13:43, schrieb Michael Van Canneyt: On Thu, 7 Oct 2010, Sven Barth wrote: So: Norms ? Thank you, but I'll pass on that and implement what I perc

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Sven Barth
Am 07.10.2010 14:21, schrieb Michael Van Canneyt: On Thu, 7 Oct 2010, Sven Barth wrote: Am 07.10.2010 13:43, schrieb Michael Van Canneyt: On Thu, 7 Oct 2010, Sven Barth wrote: So: Norms ? Thank you, but I'll pass on that and implement what I perceive as simple and correct :-) If the ap

Re: [fpc-pascal] lNet getting the local IP

2010-10-07 Thread silvioprog
Wow, worked perfectely in Ubuntu-10.04, Mandriva-2010 and openSUSE-11.2. Thanks for the exelent solutions. :) 2010/10/7 Brian Winfrey > > I found an example for linux on stack overflow that was in c > > http://stackoverflow.com/questions/212528/linux-c-get-the-ip-address-of-local-computer > > -

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Michael Van Canneyt
On Thu, 7 Oct 2010, Sven Barth wrote: Am 07.10.2010 13:43, schrieb Michael Van Canneyt: On Thu, 7 Oct 2010, Sven Barth wrote: So: Norms ? Thank you, but I'll pass on that and implement what I perceive as simple and correct :-) If the applications would keep their read only files in 'c:\

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Sven Barth
Am 07.10.2010 13:43, schrieb Michael Van Canneyt: On Thu, 7 Oct 2010, Sven Barth wrote: So: Norms ? Thank you, but I'll pass on that and implement what I perceive as simple and correct :-) If the applications would keep their read only files in 'c:\program files' and write only into those d

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Michael Van Canneyt
On Thu, 7 Oct 2010, Sven Barth wrote: So: Norms ? Thank you, but I'll pass on that and implement what I perceive as simple and correct :-) If the applications would keep their read only files in 'c:\program files' and write only into those directories that they should (e.g. user's appdata

[fpc-pascal] Re: Build scripts for Freepascal and Lazarus compilation from source

2010-10-07 Thread Frank Church
On 3 October 2010 10:25, Frank Church wrote: > > I have posted an article and some code on some bash scripts I have > developed to install FPC and Lazarus from source at > http://devblog.brahmancreations.com/content/build-scripts-for-installing-freepascal-and-lazarus-from-source > . > > Any comme

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Sven Barth
Am 07.10.2010 10:40, schrieb Michael Van Canneyt: Aahhh.. Norms. Right. like all config files should go in ~/.config/, as proposed 5 years ago, because ~/.program/ is "not the norm" (dumping a successful 20-year old practise for no apparent good reason). Meanwhile I'm still waiting for the first

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Graeme Geldenhuys
On 7 October 2010 10:58, Graeme Geldenhuys wrote: > Well, then here it is In my ~/.config/ I have the following > non-FPC projects config files > > * enchant > * f-spot > * google-chrome > * indicators > * helix > * gnome-disk-utility > * gnome-session > * gnome-mplayer > * gtk-2.0 > * softwar

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Sven Barth
Am 06.10.2010 23:57, schrieb Jonathan: On Wed, 06 Oct 2010 09:40:42 +0200 Sven Barth wrote: Windows (or at least ReactOS) seems to use GetTickCount to generate a random filename: Do not you use random file names without a subdirectory because you can not use Tomoyo or Apparmour to lock the p

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Graeme Geldenhuys
On 7 October 2010 10:40, Michael Van Canneyt wrote: > > Meanwhile I'm still waiting for the first non-fpc app to write it's config > files in that directory (using Kubuntu, BTW). All other apps I use still > happily write in ~/.program/ Well, then here it is In my ~/.config/ I have the follow

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Michael Van Canneyt
On Thu, 7 Oct 2010, Graeme Geldenhuys wrote: On 6 October 2010 23:57, Jonathan wrote: Create a folder in the temp directory naming it after the user name. E.g /tmp/myusername/ Ensure only the owner can read and write in the folder. Create a folder in "/tmp/myusername/" using your program na

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Graeme Geldenhuys
On 6 October 2010 23:57, Jonathan wrote: > Create a folder in the temp directory naming it after the user name. E.g > /tmp/myusername/ > Ensure only the owner can read and write in the folder. > Create a folder in "/tmp/myusername/" using your program name. > Then create your temp file. so you ha

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Giuliano Colla
Michael Van Canneyt ha scritto: On Wed, 6 Oct 2010, Jonas Maebe wrote: On 06 Oct 2010, at 11:05, Michael Van Canneyt wrote: On Wed, 6 Oct 2010, Jonas Maebe wrote: On 06 Oct 2010, at 09:41, Michael Van Canneyt wrote: This is always true on Unix, the only way to make sure is to have the

Re: [fpc-pascal] GetTempFileName in Linux

2010-10-07 Thread Michael Van Canneyt
On Wed, 6 Oct 2010, Jonathan wrote: On Wed, 6 Oct 2010 09:41:03 +0200 (CEST) Michael Van Canneyt wrote: I'm open for some more sophisticated algorithm which does some more checking. Michael. Honour one of the temp directory environment variables, I know of TMPDIR, TEMP, TMP. I think it