Re: [fpc-pascal] How to get the permission f a file ?
> Fred, the tiSetFileReadOnly() I sent you the other day already uses > fpstat() before checking/setting the read-only flag. So you are halfway > there. ;-) Yep, many thanks. ;-) PS: Bart's tip works like lovely charm... => function FileIsExecutable(const AFilename: string): boolean; var Info : Stat; begin // first check AFilename is not a directory and then check if executable Result:= (FpStat(AFilename,info{%H-})<>-1) and FPS_ISREG(info.st_mode) and (BaseUnix.FpAccess(AFilename,BaseUnix.X_OK)=0); end; Fre;D ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] FPC ARMEL and ARMHF under the same tree
I currently have my [cross-]compilers under the same tree, to ease management and the ability to use single fpc.cfg. AFAIU FPC ARMEL and ARMHF are two distinct targets, thus two distinct compiler binary. However, the compiler binary has the same name. So, how can I have both under the same tree? I need to target both arm-android (my phone) and arm-linux (Raspberry Pi). -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/FPC-ARMEL-and-ARMHF-under-the-same-tree-tp5721845.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to get the permission f a file ?
On 2015-06-17 16:00, fredvs wrote: > And you give me choice...;-) > I will study your tips and then choose one of them... Fred, the tiSetFileReadOnly() I sent you the other day already uses fpstat() before checking/setting the read-only flag. So you are halfway there. ;-) Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpGUI Features
On 06/17/2015 02:53 PM, Michael Van Canneyt wrote: Using the HTML5 canvas is IMHO the worst possible approach to programming the web. A WEB GUI such as the QNAP NAS boxes provide seems very appropriate. I did not find out what tool set they use :-( . -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpGUI Features
On 2015-06-17 13:38, Leonardo M. Ramé wrote: > but did you take a look at this? http://www.zebkit.com/ That's a good start. Just tried it with my Firefox 38.0.1 and the demo doesn't work at all. No mouse over detected, can't click any of the demo's tabs. Then tried with Chromium 42, and finally something works. And that is why I love (not) the web. :-D Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to get the permission f a file ?
Hi, On Wed, 17 Jun 2015, fredvs wrote: > But how to check if a file has executable permission (and if not, change it > with fpchmod(thefile S_IRWXU);) ? >From the top of my head: fpStat(), and in the returned stat structure, look for the mode field (or st_mode?). There are more useful bits in there. There is also fpFStat() and fpLStat() (for symlinks). There are also several S_* constants in BaseUnix unit for easier testing of various permission combinations. Charlie ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to get the permission f a file ?
@ Bart and Ewald. => excellent, many thanks. And you give me choice...;-) I will study your tips and then choose one of them... Many thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-to-get-the-permission-f-a-file-tp5721836p5721840.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to get the permission f a file ?
On 06/17/2015 04:42 PM, fredvs wrote: > But how to check if a file has executable permission (and if not, change it > with fpchmod(thefile S_IRWXU);) ? stat? See: http://linux.die.net/man/2/stat http://www.freepascal.org/docs-html/rtl/baseunix/fpstat.html http://www.freepascal.org/docs-html/rtl/baseunix/stat.html -- Ewald ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] How to get the permission f a file ?
On 6/17/15, fredvs wrote: > But how to check if a file has executable permission (and if not, change it > with fpchmod(thefile S_IRWXU);) ? function FileIsExecutable(const AFilename: string): boolean; var Info : Stat; begin // first check AFilename is not a directory and then check if executable Result:= (FpStat(AFilename,info{%H-})<>-1) and FPS_ISREG(info.st_mode) and (BaseUnix.FpAccess(AFilename,BaseUnix.X_OK)=0); end; (From LazFileUtils unit of Lazarus) Bart ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpGUI Features
On 2015-06-17 13:38, Leonardo M. Ramé wrote: > Hi Graeme, I know you hate web stuff, Damn, I didn't know it was such public knowledge. ;-) > but did you take a look at this? > http://www.zebkit.com/ Wow, very interesting. I haven't seen that before. > Its something similar to your approach with fpGui, but using HTML5 > Canvas, I'm dreaming of seeing fpGui on the web, generated from FPC. I always welcome patches. ;-) With the 'develop' branch now having configurable window handles (default is one window handle per Form, not widget), it should make it a bit easier. I believe Michael or somebody else has (or is) working an a Object Pascal to JavaScript compiler. So maybe there is hope for your dream. Just don't wait for me to implement it please. :) Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
[fpc-pascal] How to get the permission f a file ?
Hello. With fpchmod(), it is possible to change the permission of a file. Perfect. But how to check if a file has executable permission (and if not, change it with fpchmod(thefile S_IRWXU);) ? Many thanks. Fre;D - Many thanks ;-) -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/How-to-get-the-permission-f-a-file-tp5721836.html Sent from the Free Pascal - General mailing list archive at Nabble.com. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpGUI Features
On Wed, 17 Jun 2015, Leonardo M. Ramé wrote: Hi Graeme, I know you hate web stuff, but did you take a look at this? http://www.zebkit.com/ Its something similar to your approach with fpGui, but using HTML5 Canvas, I'm dreaming of seeing fpGui on the web, generated from FPC Using the HTML5 canvas is IMHO the worst possible approach to programming the web. None of the regular browser features will work. Find does not work, accessibility does not work. Maybe good for graphical games, but for regular apps this is really the worst option. Michael.___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpGUI Features
Hi Graeme, I know you hate web stuff, but did you take a look at this? http://www.zebkit.com/ Its something similar to your approach with fpGui, but using HTML5 Canvas, I'm dreaming of seeing fpGui on the web, generated from FPC. Leonardo M. Ramé http://leonardorame.blogspot.com From: Graeme Geldenhuys To: fpc-pascal@lists.freepascal.org Sent: Wednesday, June 17, 2015 5:20 AM Subject: Re: [fpc-pascal] fpGUI Features On 2015-06-17 04:26, Horacio Jamilis wrote: > Does it support Android on any way? I once heard somebody was working on a port, but I can't remember who that was. If LCL-Customdrawn could do it, then it must be possible with fpGUI too. I unfortunately don't know anything about Android development yet. > enaught to me (the edit control does not work as good as I expected). No surprise really. The LCL-Customdrawn widgetset is still in Alpha state, and it needs a lot more development effort before it is usable even on a desktop environment. There are a lot of things still missing. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Re: [fpc-pascal] fpGUI Features
On 2015-06-17 04:26, Horacio Jamilis wrote: > Does it support Android on any way? I once heard somebody was working on a port, but I can't remember who that was. If LCL-Customdrawn could do it, then it must be possible with fpGUI too. I unfortunately don't know anything about Android development yet. > enaught to me (the edit control does not work as good as I expected). No surprise really. The LCL-Customdrawn widgetset is still in Alpha state, and it needs a lot more development effort before it is usable even on a desktop environment. There are a lot of things still missing. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal