[SOLVED] Ubuntu restriction policy and baselinux with Ttime ? lazarus / 32-Linux ---------------------------------------------------------------------- Fred vS · 2011-08-27 19:18 Hello everybody. I have just done (2011-09-27) a update of my Ubuntu 11.04 (last update 2011-09-25)... After that i noted that all the AProcess.Execute inside the executable are blocked... I have to change the permission of the executable to unblock it. To do that, right click on the executable then choose properties and then enable execute for all users.  By the way is there a tips to change the permission of a file with Lazarus ? Thanks ---------------------------------------------------------------------- marcov · 2011-08-27 21:48 fpchmod from the baseunix unit ---------------------------------------------------------------------- Fred vS · 2011-08-28 16:42 @ Marcov : many thanks. ---------------------------------------------------------------------- Fred vS · 2011-08-30 14:54 Hello everybody. I can change the permissions with : Code: [Select]fpchmod(application.Location + 'miximum',S_IRWXU) and change to executable with : Code: [Select]fpChmod(application.Location + 'miximum',&777) Perfect but.... If i use baseunix and if i declare a Ttime variabe and want to use it i get a error message.  For example : Code: [Select]procedure error_using_ttime_whith_baseunix(); var timeinit : ttime; begin timeinit := now; end; I get that error message while trying to compil : Quotemiximum.pas(18094,15) Error: Incompatible types: got "TDateTime" expected "LongInt"  Must i forget to use a ttime variable while using baseunix ? Thanks ---------------------------------------------------------------------- BigChimp · 2011-08-30 15:16 If that happens, try to prefix the variable declaration with the unit it comes from (e.g. sysutils, I don't know, you'd have to look it up): Code: [Select]var timeinit : Whateverunit.ttime; Also, I believe the order in which ypu place your units in the uses clause can have an effect on priority, but I haven't really used that functionality... ---------------------------------------------------------------------- Fred vS · 2011-08-30 15:20 @ BigChimp: Thanks, i gonna try it tonight... ---------------------------------------------------------------------- Leledumbo · 2011-08-30 15:25 Shouldn't it be: Code: [Select]timeinit := TimeOf(Now); ---------------------------------------------------------------------- Fred vS · 2011-08-30 15:58 @ Leledumbo : Without baseunix Code: [Select]timeinit :=  Now; is working perfectly since ages. But i gonna try your code with baseunix this night too.  Code: [Select]timeinit := TimeOf(Now); Thanks ---------------------------------------------------------------------- Fred vS · 2011-08-30 17:01 @ BigChimp Code: [Select]uses SysUtils, Forms, StdCtrls, BaseUnix ; timeinit := SysUtils.Now; Quotepermis.pas(40,13) Error: Incompatible types: got "TDateTime" expected "LongInt"  @ Leledumbo Code: [Select]timeinit :=  TimeOf(Now); Quotepermis.pas(40,19) Error: Identifier not found "TimeOf" ---------------------------------------------------------------------- Leledumbo · 2011-08-30 17:54 Quotepermis.pas(40,19) Error: Identifier not found "TimeOf"Add DateUtils to your uses clause ---------------------------------------------------------------------- Fred vS · 2011-08-30 21:44 @ Leledumbo Code: [Select]uses SysUtils, Forms, Dialogs, StdCtrls, DateUtils, baseunix;     Procedure time_baseunix(); var   timeinit : ttime; begin timeinit := TimeOf(Now);  end; gives : Quotepermis.pas(38,13) Error: Incompatible types: got "TDateTime" expected "LongInt" ---------------------------------------------------------------------- Blaazen · 2011-08-30 23:36 Change (specify) declaration to: Code: [Select]Procedure time_baseunix(); var   timeinit : system.ttime; .... because there is also another TTime declared in unit "baseunix" which is selected by default and you need the other one. ---------------------------------------------------------------------- Fred vS · 2011-08-31 21:13 @ Mr Blaazen : once again you are the winner  Quotevar   timeinit : system.ttime; timeinit := now; : works like charm