Re: Getting the total size of a directory

2004-01-05 Thread Rus Foster
On Sun, 4 Jan 2004 [EMAIL PROTECTED] wrote: > I'm running out of web space and want to write a script that tell me the size > of certain directories so I can see where the hog is. > > Can anyone give me some quick code? A shell script might be even faster with du -s /tmp | sort -n Rus -- e: [E

Re: Get file size without downloading

2003-12-10 Thread Rus Foster
On Wed, 10 Dec 2003, usef wrote: > Hi, > Is there any way to get the size of a file without downloading it? > I want to write a program using LWP to download a file only if it is bigger > than 3K but smaller than 500K. > So I need to know the file size in the first place. > Hi, FTP or HTTP? Rgds

Re: "HTH"

2003-07-24 Thread Rus Foster
On Thu, 24 Jul 2003, Jeff Westman wrote: > Hi, > > Okay guys, what does this mean? Several of you 'sign' with this. > > HTH (lol) > Hope That Helps HTH :) Rus -- www: http://jvds.com | Virtual Servers from just $15/mo MSNM: [EMAIL PROTECTED] | Totally Customizable Technology e: [EMAIL PROTEC

Re: Checking for a directory

2003-07-24 Thread Rus Foster
On Thu, 24 Jul 2003, LI NGOK LAM wrote: > if ( -d $path ) { print "Directory" } > elsif ( -f $path ) { print "File" } > else { print "Not exist" } > > HTH Cheers all. Think I was trying to be to clever for my own good RGds ]Rus -- www: http://jvds.com | Virtual Servers from just $15/mo MSNM:

Checking for a directory

2003-07-24 Thread Rus Foster
Hi All, Just trying to work out the code to test if a path is a directory or file. Looked over the stat function but doesn't quite seem right. Can someone give me a clue thanks Rus -- www: http://jvds.com | Virtual Servers from just $15/mo MSNM: [EMAIL PROTECTED] | Totally Customizable Techno

Being a moron CGI.pm

2003-07-12 Thread Rus Foster
Hi All, I know what I'm about to ask is a really stupid question but I just can't get my head around my first outing with CGI.pm. I've RTFM as appropiate but getting nowhere. All I want to do is dump a list of variable and their values which have been parsed to a script. So far I have #!/usr/bin/p

Re: Free cgi-bin?

2003-03-17 Thread Rus Foster
On Mon, 17 Mar 2003, Liebert, Sander wrote: > > > > Does anyone know of a free cgi-bin. I am having some problems with a > > script and wanted to narrow it down to rule out email. I don't need a > > free website, just a place that can run and execute my script. I have > > searched on google, but

MLDBM adding records

2002-10-15 Thread Rus Foster
Hi all, I'm trying to do a proof of concept for myself using MLDBM of basically trying to add two records to a hash. ATM I have the following code #!/usr/bin/perl use strict ; use warnings ; use MLDBM; use Fcntl ; my %hash ; my $filename = "/tmp/filt" ; unlink $file

Re: uptime

2002-10-03 Thread Rus Foster
On 3 Oct 2002, chad kellerman wrote: > Hi everyone, > > What would be the easiest way to find the uptime of a linux > machine? I don't want to use a system call. Is there a module I can > use? Or do I have to open /proc/uptime and calculate it thru there? > Prase the output of the command

Re: ascertain current username

2002-08-16 Thread Rus Foster
On Fri, 16 Aug 2002 [EMAIL PROTECTED] wrote: > Hello, > does anybody know a possibility how to ascertain the current User (User Id, > Username) ? > I thougt of using a module but couldn't find one. > > > greetings > Stefan > Or following up on my own post (which is bad) just found out you could

Re: ascertain current username

2002-08-16 Thread Rus Foster
On Fri, 16 Aug 2002 [EMAIL PROTECTED] wrote: > Hello, > does anybody know a possibility how to ascertain the current User (User Id, > Username) ? > I thougt of using a module but couldn't find one. Have you tired parsing the output from the commands "id -h" and "id -u"? Rgds Rus -- http://www.

Sys::Syslog

2002-04-29 Thread Rus Foster
Hi all, I've wonder if you get help me with a problem I'm having. ATM I've managed to log to my local syslog using the following code #!/usr/sbin/perl use Sys::Syslog qw(); $user = $ENV{'USER'}; openlog($0,'','user'); syslog('info', "$user logged this comment"); closelog; What I would however

FIFO handeling

2002-04-25 Thread Rus Foster
pass characters this works. However when I send ^D the script exists. Is there anyway to avoid this and keep the file handel open Rdgs Rus Foster -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Regexp on variable

2001-12-13 Thread Rus Foster
Hi All, I've google for this but for the life of me I can't find it. Basic premise is that I have a variable, want to run a regexp over it and then put the results back into itself. So far I have my $foo="bar"; $_ = $foo; $foo =~ s/bar/goo/g; There has to be a better way hasn't there? Rus -