Mac app to read system log file

Bill Vlahos bvlahos at mac.com
Wed Dec 1 16:16:20 EST 2010


Phil,

That works perfectly.

In my program I will be importing many files at once using drag and drop. The code below works fine except that it asks for authentication for each file as it loops through them. Is there a way I can issue the elevated command so that it only asks me once?

on dragDrop
   put empty into field "raw" --initializes the field
   repeat for each line i in the dragdata["files"]
      if ".local" is in i then --check for correct type of file
         put "cat" && quote & i & quote into tCommand
         open elevated process tCommand for read
         if the result <> empty then exit to top -- user cancelled authentication
         read from process tCommand until EOF
         put it & return after field "raw"
      end if
   end repeat
end dragDrop

Thank you very much.
Bill Vlahos

On Nov 24, 2010, at 1:44 PM, Phil Davis wrote:

> on mouseUp
>   answer file "???"
>   if it = empty then exit to top
>   put "cat" && quote & it & quote into tCommand
> 
>   open elevated process tCommand for read
>   if the result <> empty then exit to top -- user canceled
>   read from process tCommand until EOF
>   put it into fld 1
>   close process tCommand
> end mouseUp
> 
> 
> Happy Thanksgiving!
> Phil
> 
> 
> On 11/24/10 12:04 PM, Bill Vlahos wrote:
>> I have a Mac application to read log files that need administrative permission (sudo) to read. How can I prompt for this?
>> 
>> Bill Vlahos
>> _________________
>> InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.
> 
> -- 
> Phil Davis
> 
> PDS Labs
> Professional Software Development
> http://pdslabs.net
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list