How to Understand file writing in Progress in UNIX?
Hi All,
I have a requirement, where i have to pool file A data to file B continuously and need to process the data in the file B.
Since the data need to be processed only once so i have to truncate the data in file A after every pool. So that on the next pooling i can get the fresh data and there will be no duplication.
Issue: In case when i am truncating the data of FileA if some date getting written on the FileA then it will also get truncated. So i am looking for a process where i can capture that the file is getting written or some way by which i can lock the file for truncation.
My piece of sample code:
Thanks for you Suggestion in Advance
Moderator's Comments:
Please use code tags
Last edited by jim mcnamara; 06-04-2015 at 09:52 AM..
I want to collect the database tables(Ex: Emp,Sal,Bonus...etc)
in a file & give this file at the command prompt, when prompted for the tables list at command prompt. How can i do that ?
Ex:- Import jason/jason1 tables=emp,sal,bonus log=j1.log
i want to change this into
Ex:- Import... (3 Replies)
We are currently running HP-UX 11 as our database server. The database is Progress version 9.1C.
As of late, some of our batch processes that run on the UNIX db server are erroring out because of what appear to be memory issues(at least according to Progress). The db error messages indicate... (0 Replies)
if {"$my_ext_type" = MAIN]; then
cd $v_sc_dir
Filex.SH $v_so_dir\/$v_fr_file
Can somebody tell me what does this suggest. I am pretty new to unix and
I am getting confused.
What i understood from here is
If we have a file extension name as MAIN
which we have then we change the directory to... (1 Reply)
Hi Programmers,
I just wrote a small script to print the percent complete.
This maybe useful for someone!
#!/usr/local/bin/perl
# Total from which percentage will be calculated
$cnt = 16;
$|=1;
for($i=0;$i<$cnt;$i++)
{
# Calculate Percentage
$percent = ($i/$cnt)*100; (13 Replies)
I am an entry level programmer with no formal training in computer science. I am trying to enhance my conceptual knowledge about operating systems in general.
I have been using the C programming language on Linux systems for some time and have used the traditional unix stream I/O APIs. The... (1 Reply)
Hi All,
I have a unix old script i but i am not able to understand the few commands in it and what it does. below is the script.
if ;
then
for F in $(find $DIR/. ! -name . -prune -name "DP_*.dat")
do
IN=${F##/*/}
OUT='ORD'$(echo $IN | cut -c7-)
exec.ksh $IN... (2 Replies)
i have an existing script that is used to send an e-mail containing the alrams that appear on the server.
But i need to create a daily log file containing all the alarms that was send that day.
i tired to add at the and of the script a command, echo command but for some reason the file was... (1 Reply)
How to understand the unix time format as here i have pasted this is a unix time 1402565420 and its 3:00 PM here but its give this Output as long number How can i make it to understand format as i have 3:00 PM
Normal time format <----3:00PM = 1402565420----> Unix Time
Will Any one Explain to... (4 Replies)
Hi, I am complete new to C programming and shell scripting. I just wrote a simple C code to calculate integral using trapezoid rule. I am prompting user to pass me No. of equally spaced points , N , upper and lower limit. My code looks as follows so far:
#include<stdio.h>
#include<string.h>... (2 Replies)
Discussion started by: bjhjh
2 Replies
LEARN ABOUT SUSE
mail::spamassassin::util::progress
Mail::SpamAssassin::Util::Progress(3) User Contributed Perl Documentation Mail::SpamAssassin::Util::Progress(3)NAME
Mail::SpamAssassin::Util::Progress - Progress bar support for SpamAssassin
SYNOPSIS
my $progress = Mail::SpamAssassin::Util::Progress->new({total => 100});
$msgcount = 0;
foreach my $message (@messages) {
# do something here
$msgcount++;
$progress->update($msgcount);
}
$progress->final();
DESCRIPTION
This module implements a progress bar for use in SpamAssassin scripts and modules. It allows you to create the progress bar, update it and
print out the final results of a particular run.
new
public class (Mail::SpamAssassin::Util::Progress) new (\% $args)
Description: Creates a new Mail::SpamAssassin::Util::Progress object, valid values for the $args hashref are:
total (required)
The total number of messages expected to be processed. This item is required.
fh [optional]
An optional filehandle may be passed in, otherwise STDERR will be used by default.
term [optional]
The module will attempt to determine if a valid terminal exists on the STDIN filehandle. This item allows you to override that value.
init_bar
public instance () init_bar()
Description: This method creates the initial progress bar and is called automatically from new. In addition you can call init_bar on an
existing object to reset the bar to it's original state.
update
public instance () update ([Integer $num_done])
Description: This method is what gets called to update the progress bar. You may optionally pass in an integer value that indicates how
many messages have been processed. If you do not pass anything in then the num_done value will be incremented by one.
final
public instance () final ([Integer $num_done])
Description: This method should be called once all processing has finished. It will print out the final msgs per sec calculation and the
total time taken. You can optionally pass in a num_done value, otherwise it will use the value calculated from the last call to update.
perl v5.12.1 2010-03-16 Mail::SpamAssassin::Util::Progress(3)