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
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
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
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
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
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
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
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
,
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
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
::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
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
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
.
--
Thanks,
James Reynolds
University of Utah
Student Computing Labs
[EMAIL PROTECTED]
801-585-9811
:
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
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
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
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
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
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
, 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
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
22 matches
Mail list logo