Hi ,
I have a question about performance of writing into a file.
Will it take more time to open a file, write a line into the file and close the file
if the file size grows bigger and bigger??
Say, I have two files of sizes 100KB and 20MB.
Will it take more time to open/write a... (1 Reply)
About 4 years ago I wrote this tool inspired by Rob Urban's collect tool for DEC's Tru64 Unix. What makes this tool as different as collect was in its day is its ability to run at a low overhead and collect tons of stuff. I've expanded the general concept and even include data not available in... (0 Replies)
Hi All
I am reading a huge file of size 2GB atleast. I am reading each line and cutting certain columns and writing it to another file.
Here is the logic.
int main()
{
string u_line;
string Char_List;
string u_file;
int line_pos;
string temp_form_u_file;
... (10 Replies)
hi all,
I was able to do a script to gather a few files and sort them.
here it is:
#!/usr/bin/ksh
ls *mainFile* |cut -c20-21 | sort > temp
set -A line_array
i=0
file_name='temp'
while read file_line
do
line_array=${file_line}
let i=${i}+1 (5 Replies)
Hello,
I'm running a script on AIX to process lines in a file. I need to enclose the second column in quotation marks and write each line to a new file. I've come up with the following:
#!/bin/ksh
filename=$1
exec >> $filename.new
cat $filename | while read LINE
do
echo $LINE | awk... (2 Replies)
Hello Gurus,
We are facing some performance issue in UNIX. If someone had faced such kind of issue in past please provide your suggestions on this .
Problem Definition:
/Few of load processes of our Finance Application are facing issue in UNIX when they uses a shell script having below... (19 Replies)
Hi guys,
what is the relation between I/O performance and file systems.
I have a file systems called /dcs/data01 which is having 4Tb size.
According our application we can split the file system like
dcs/data01 -> 1Tb
dcs/data02 -> 1Tb
dcs/data03 -> 1Tb
dcs/data04 -> 1Tb
do you... (4 Replies)
Please, I need help tuning my script. It works but it's too slow.
The code reads an acivity log file with 50.000 - 100.000 lines and filters error messages from it. The data in the actlog file look similar to this:
02/08/2011 00:25:01,ANR2034E QUERY MOUNT: No match found using this criteria.... (5 Replies)
Hello all -
I am to this forum and fairly new in learning unix and finding some difficulty in preparing a small shell script. I am trying to make script to sort all the files given by user as input (either the exact full name of the file or say the files matching the criteria like all files... (3 Replies)
Hi Experts,
I have a filelist collected from another server , now want to sort the output using date/time stamp filed.
- Filed 6, 7,8 are showing the date/time/stamp.
Here is the input:
#----------------------------------------------------------------------
-rw------- 1 root ... (3 Replies)
Discussion started by: rveri
3 Replies
LEARN ABOUT MOJAVE
file::remove5.18
File::Remove(3) User Contributed Perl Documentation File::Remove(3)NAME
File::Remove - Remove files and directories
SYNOPSIS
use File::Remove 'remove';
# removes (without recursion) several files
remove( '*.c', '*.pl' );
# removes (with recursion) several directories
remove( 1, qw{directory1 directory2} );
# removes (with recursion) several files and directories
remove( 1, qw{file1 file2 directory1 *~} );
# trashes (with support for undeleting later) several files
trash( '*~' );
DESCRIPTION
File::Remove::remove removes files and directories. It acts like /bin/rm, for the most part. Although "unlink" can be given a list of
files, it will not remove directories; this module remedies that. It also accepts wildcards, * and ?, as arguments for filenames.
File::Remove::trash accepts the same arguments as remove, with the addition of an optional, infrequently used "other platforms" hashref.
SUBROUTINES
remove
Removes files and directories. Directories are removed recursively like in rm -rf if the first argument is a reference to a scalar that
evaluates to true. If the first arguemnt is a reference to a scalar then it is used as the value of the recursive flag. By default it's
false so only pass 1 to it.
In list context it returns a list of files/directories removed, in scalar context it returns the number of files/directories removed. The
list/number should match what was passed in if everything went well.
rm
Just calls remove. It's there for people who get tired of typing remove.
clear
The "clear" function is a version of "remove" designed for use in test scripts. It takes a list of paths that it will both initially delete
during the current test run, and then further flag for deletion at END-time as a convenience for the next test run.
trash
Removes files and directories, with support for undeleting later. Accepts an optional "other platforms" hashref, passing the remaining
arguments to remove.
Win32
Requires Win32::FileOp.
Installation not actually enforced on Win32 yet, since Win32::FileOp has badly failing dependencies at time of writing.
OS X
Requires Mac::Glue.
Other platforms
The first argument to trash() must be a hashref with two keys, 'rmdir' and 'unlink', each referencing a coderef. The coderefs will be
called with the filenames that are to be deleted.
SUPPORT
Bugs should always be submitted via the CPAN bug tracker
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Remove>
For other issues, contact the maintainer.
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT
Some parts copyright 2006 - 2012 Adam Kennedy.
Taken over by Adam Kennedy <adamk@cpan.org> to fix the "deep readonly files" bug, and do some package cleaning.
Some parts copyright 2004 - 2005 Richard Soderberg.
Taken over by Richard Soderberg <perl@crystalflame.net> to port it to File::Spec and add tests.
Original copyright: 1998 by Gabor Egressy, <gabor@vmunix.com>.
This program is free software; you can redistribute and/or modify it under the same terms as Perl itself.
perl v5.18.2 2012-03-18 File::Remove(3)