hi,
How can i rename a file and check the size of file using perl?
Also is there a way to call unix commands/system calls from perl?(Say i
want to fstat() on a file and grab the stat struct results). Is there any
way??
TIA
-Ajey
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
It was Saturday, December 13, 2003 when Ajey Kulkarni took the soap box, saying:
: hi,
: How can i rename a file and check the size of file using perl?
Use the rename() function.
rename( $oldfile, $newfile );
perldoc -f rename()
Use the file test operators, particularly -s.
my $size =
Ajey Kulkarni wrote:
[some stuff]
Before this gets lost as a subthread I'm reposting it.
I hope I catch most potential responses.
Rob
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
-f rename
That should get you started
-Original Message-
From: Ajey Kulkarni [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 13, 2003 3:21 AM
To: drieux
Cc: Perl Perl
Subject: some doubt
hi,
How can i rename a file and check the size of file using perl?
Also is there a way to call
Ajey Kulkarni wrote:
How can i rename a file and check the size of file using perl?
Also is there a way to call unix commands/system calls from perl?(Say i
want to fstat() on a file and grab the stat struct results). Is there any
way??
You can grab the size of a file using the -s operator on
Yes, do a search on google. I did this.
-Jim
- Original Message -
From: Ajey Kulkarni [EMAIL PROTECTED]
To: drieux [EMAIL PROTECTED]
Cc: Perl Perl [EMAIL PROTECTED]
Sent: Saturday, December 13, 2003 6:20 AM
Subject: some doubt
hi,
How can i rename a file and check the size of file
hi
i have a prog which should create a file according to the date and name
it $date.log and write something depending upon other things in it!
Here is the code.. which refuses to work
any clues.. ?
TIA
pravesh
--
#!/usr/bin/perl -w
.--[ Pravesh Biyani wrote (2002/11/12 at 17:49:14) ]--
|
| hi
| i have a prog which should create a file according to the date and name
| it $date.log and write something depending upon other things in it!
| Here is the code.. which refuses to work
|
| any clues.. ?
|
--- Pravesh Biyani [EMAIL PROTECTED] wrote:
i have a prog which should create a file according to the date
and name it $date.log and write something depending upon
other things in it! Here is the code.. which refuses to work
any clues.. ?
$prefix_file = ` date '+%x' ` ;
according to
| $probefile = probe.log ;
| $OUTFILE = $probe_logfile;
| open(probefile) or die(ERROR: $! \n);
| open(OUTFILE) or die (ERRROR :$! \n);
You're not using open() correctly. You need to have something
along the lines of:
open(PROBE, $profile);
open(OUT, $OUTFILE);
thanks verymuch.. the prgm working fine now!!
cheers
pravesh
Frank Wiles wrote:
.--[ Pravesh Biyani wrote (2002/11/12 at 17:49:14) ]--
|
| hi
| i have a prog which should create a file according to the date and name
| it $date.log and write something depending upon other things
Pravesh Biyani wrote:
hi
Hello,
i have a prog which should create a file according to the date and name
it $date.log and write something depending upon other things in it!
Here is the code.. which refuses to work
--
12 matches
Mail list logo