Re: Parsing com.apple.sidebar.plist alias data. Can Mac::Files help?

2007-10-24 Thread James Reynolds
Hi, I've written some code to handle relocating of user home folders, in particular, the rewriting of full paths in preference files. For the majority of applications, this all works sweetly with Foundation.pm and the usual NSDictionary calls. However I am running into issues with the

flock

2006-02-02 Thread James Reynolds
As I understand it, in C, if I open (create) a file and want to lock it, I should pass in the O_EXLOCK flag at the same time, otherwise, I've got a race condition, another process could potentially lock the file after I've created it, but before I've locked it. Does Perl have this problem if

Re: Finding the current user

2006-01-06 Thread James Reynolds
Thanks everyone! I suppose I should learn all the special variables after all... James At 7:52 PM -0500 1/5/06, Sherm Pendley wrote: On Jan 5, 2006, at 6:04 PM, Sherm Pendley wrote: If you need more than the numeric user ID, have a look at: perldoc getpwnam perldoc

Finding the current user

2006-01-05 Thread James Reynolds
I know I can get this with `whoami`, but I was wondering if there was a Perl way to find the user who executed the script. I basically want to make it so my script is executable by normal users, but prints an error if it is not only the root user. -- Thanks, James Reynolds University

CPAN modules not included with OS X

2005-12-29 Thread James Reynolds
Does anyone know why Apple chooses or not chooses to include modules? I really dislike installing them. And more and more I find I need to. So how would I go about pressuring Apple to include more. -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED] 801

Re: CPAN modules not included with OS X

2005-12-29 Thread James Reynolds
On Thu, 29 Dec 2005, James Reynolds wrote: Does anyone know why Apple chooses or not chooses to include modules? I really dislike installing them. And more and more I find I need to. So how would I go about pressuring Apple to include more. No vendor includes a full CPAN library

Re: CPAN modules not included with OS X

2005-12-29 Thread James Reynolds
be installed as well. Simply copying the Perl directory over won't get everything that is needed. On Thu, 2005-12-29 at 13:05, James Reynolds wrote: Does anyone know why Apple chooses or not chooses to include modules? I really dislike installing them. And more and more I find I need to. So how would

Re: eval a string with a hash ref?

2005-11-13 Thread James Reynolds
knew I would be building the functions over time and I know I will always be missing some as there are potentially thousands of them--each represents a Lego brick...). So the dispatch table worked fine. Thanks! -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL

eval a string with a hash ref?

2005-11-11 Thread James Reynolds
, and there will be thousands of differently named subroutines. I simplified the reason why the hash exists in this example. Needless to say I can't get out of using it that way easily, if at all. -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED] 801-585-9811

Perl equivalent of who command?

2005-11-01 Thread James Reynolds
Is there a Perl way to get the equivalent of the who shell command? Output of the who command: who username 1 console Nov 1 12:07 username2 ttyp1Nov 1 12:09 I've been running the shell command in backticks, but if I can get a Perl way, I would be much happier. -- Thanks, James

Re: How to find out if an application is running

2005-10-25 Thread James Reynolds
::Processes; use POSIX 'SIGTERM'; my $psn = IsRunning('com.apple.dock'); kill SIGTERM, GetProcessPID($psn); Don't try that with Launch 1.91! -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED] 801-585-9811

Re: How to find out if an application is running

2005-10-25 Thread James Reynolds
Sorry... It killed everything running as me. I was dumb enough to try it on my main computer. James At 6:16 PM -0500 10/25/05, Joseph Alotta wrote: why not? On Oct 25, 2005, at 6:13 PM, James Reynolds wrote: At 1:22 PM -0700 10/14/05, Chris Nandor wrote: I just uploaded Mac::Apps

Passing Perl pointers via PerlObjCBridge

2005-07-04 Thread James Reynolds
forms of the following code, and I haven't gotten anything to work correctly). #!/usr/bin/perl use Foundation; $bytes = pack (H*, 12358D ); $data = NSData-dataWithBytes_length_( \$bytes, length $bytes ); print $data-description-cString(); -- James Reynolds http://james.magnusviri.com

Re: Cp and ditto do not always copy files the same size

2003-11-25 Thread James Reynolds
. -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED] 801-585-9811

Reading preferences

2003-10-24 Thread James Reynolds
: SSHSERVER=-YES- WEBSERVER=-YES- My question is, can something similar be done in perl? Or do I have to open, read, parse, then close the preference file? -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED] 801-585-9811

Re: Reading preferences

2003-10-24 Thread James Reynolds
Ok, I think I just need to use a library or module. Sorry for asking before thinking... :-/ -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED] 801-585-9811 At 10:22 AM -0700 10/24/03, drieux wrote: On Thursday, Oct 23, 2003, at 11:15 US/Pacific, James

Re: Cron Progress Bar in OSX

2003-10-14 Thread James Reynolds
At 9:00 am -0600 13/10/03, James Reynolds wrote: This is one way to do it: on open these_items repeat with this_item in these_items set the_path to POSIX path of this_item set result to do shell script /Users/james/backatcha.pl \ the_path \ display dialog result end repeat end open

Re: Cron Progress Bar in OSX

2003-10-13 Thread James Reynolds
result to do shell script /Users/james/backatcha.pl \ the_path \ display dialog result end repeat end open Save as an application. And /Users/james/backatcha.pl is: #!/usr/bin/perl print I got: $ARGV[0]; -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED

Re: Cron Progress Bar in OSX

2003-10-13 Thread James Reynolds
and spat its status info to its stdout... Dan http://www.ihook.org I'm working on a similar app but is less functional so that it launches faster. -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED] 801-585-9811

Re: Cron Progress Bar in OSX

2003-10-13 Thread James Reynolds
At 9:00 am -0600 13/10/03, James Reynolds wrote: This is one way to do it: on open these_items repeat with this_item in these_items set the_path to POSIX path of this_item set result to do shell script /Users/james/backatcha.pl \ the_path \ This will break if there happens

Re: [OT] OSX privileges question

2003-09-23 Thread James Reynolds
, a backup copy of the cups settings replace the old ones, and cups is restarted. There is alot you can do with perl scripts running at login and logout. Also, have you considered aliases or symlinks? -- Thanks, James Reynolds University of Utah Student Computing Labs [EMAIL PROTECTED] 801-585-9811

Permissions script utility/folder tree compare script or utility

2001-11-15 Thread James Reynolds
for anything. Other useful tidbits: the script would be run every time a login or logout occurs (hook added to /etc/ttys). Anyone have any ideas? -- Thanks: James Reynolds University of Utah Library Student Computing [EMAIL PROTECTED] 801-585-9811