Sponsored Content
Full Discussion: Know File Status
Top Forums UNIX for Dummies Questions & Answers Know File Status Post 302524337 by palanisvr on Monday 23rd of May 2011 06:16:05 AM
Old 05-23-2011
Know File Status

Hi Guys,

how to know the status of a file to whether it is copied partially from the source location or completly copied. Appreciate your quick reply on this.

---------- Post updated at 05:16 AM ---------- Previous update was at 04:34 AM ----------

Code:
#!/bin/ksh
file_nm=$1
no_of_tries=5
sleeptime=10
curr_file_size() {
ls -l $file_nm | awk '{print $5}'
}

if [  -f $file_nm  ]
then
no_of_tries=5
sleeptime=10
for i in `seq $sleeptime`
do
prev_file_size=`curr_file_size`
sleep $sleeptime
if  [  $prev_file_size -eq `curr_file_size` ]
then
echo file is copied completly
exit
else
echo file is being copied
fi
done
else
echo file does not exists
fi

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

file status during FTP

Help!!!! Can Anyone out there help me? I need to write a script to automate a task to translate files. The files will be transfered through ftp to the workstation. Is there a way to check the file status whether the file has finished being transfered or still transfering. Or is there a way to... (3 Replies)
Discussion started by: sean76
3 Replies

2. UNIX for Dummies Questions & Answers

Couldn't open status file /var/samba/STATUS.LCK

I believe i have most of samba configured right but i get this error each time time try to run it. I was given suggestion that i touch the file, i did, but i still cannot rid myself of this error. Any suggestions (2 Replies)
Discussion started by: macdonto
2 Replies

3. Shell Programming and Scripting

File arrival status

If there is a file being transferred from one box to another box, How can one confirm on the 2nd box..that the file has arrived, and transfer is complete ? I mean in addition to checking the file exists, I want to confirm its transferred completely and not growing in size. (4 Replies)
Discussion started by: amsh76
4 Replies

4. Shell Programming and Scripting

check the status and send an email with status

Hi, We have a text file which has the following data. ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183 7~U~00200~000011258~0~P~< GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002 ST~997~0001 AK1~SH~247 AK2~856~2470001 AK5~A AK2~856~2470002 AK5~A... (3 Replies)
Discussion started by: isingh786
3 Replies

5. Red Hat

Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58

I have successfully installed RedHat 8.0 onto a Dell PowerEdge SC1425 today. This server has two SATA hard drives, and an IDE DVD-ROM drive. Using the following kernel parameters, i successfully installed across both hard drives from CD: ide0=0x1f0,0x3f6,14 vga=791 resolution=1024x768 expert... (5 Replies)
Discussion started by: fishsponge
5 Replies

6. UNIX for Dummies Questions & Answers

COBOL file status 39

When I execute a COBOL load module, I get the following error: $ a.out IWZ200S Error detected during OPEN for file 'ABE-INPUT'. File status is: 39. Message routine called from offset 0x38 of routine iwzWriteERRmsg. iwzWriteERRmsg called from offset 0x3c4 of routine... (3 Replies)
Discussion started by: jbrubaker
3 Replies

7. UNIX for Dummies Questions & Answers

checking the status of file ftp

Hi, I m new to unix and I need a help in FTp-ing a file. My script is given below ftp -n <<END_SCRIPT open $FTP_HOST user $FTP_USER $FTP_PASSWD lcd $TEMPFOLDER cd $FTP_LOCATION put $1 bye END_SCRIPT exit_status=$? if ; then log "successfully FTPed the file" else... (5 Replies)
Discussion started by: MeeraNair
5 Replies

8. UNIX for Advanced & Expert Users

File Status 92 reading a sequential file

Hi. I have a process that execute a Microfocus Cobol. This process read a large sequential file and update or insert in a table Oracle. This process run smoothly in some ocasions but in a file whor have more than 400,000 registers, the cobol program doesn't finish read all the records,... (3 Replies)
Discussion started by: hornam
3 Replies

9. UNIX for Dummies Questions & Answers

If (! -z $file || $status != 0 ) ... what its mean

hi can anybody help .. if (! -z $file || $status != 0 ) ... what its mean Use code tags, see PM. (6 Replies)
Discussion started by: Madhu Siddula
6 Replies

10. Programming

How to track table status delete/update/insert status in DB2 V10 z/os?

Dear Team I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) Scenario We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies
MPI_File_read_ordered(3OpenMPI) 										   MPI_File_read_ordered(3OpenMPI)

NAME
MPI_File_read_ordered - Reads a file at a location specified by a shared file pointer (blocking, collective). SYNTAX
C Syntax #include <mpi.h> int MPI_File_read_ordered(MPI_File fh, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) Fortran Syntax INCLUDE 'mpif.h' MPI_FILE_READ_ORDERED(FH, BUF, COUNT, DATATYPE, STATUS, IERROR) <type> BUF(*) INTEGER FH, COUNT, DATATYPE, STATUS(MPI_STATUS_SIZE), IERROR C++ Syntax #include <mpi.h> void MPI::File::Read_ordered(void* buf, int count, const MPI::Datatype& datatype, MPI::Status& status) void MPI::File::Read_ordered(void* buf, int count, const MPI::Datatype& datatype) INPUT PARAMETERS
fh File handle (handle). count Number of elements in buffer (integer). datatype Data type of each buffer element (handle). OUTPUT PARAMETERS
buf Initial address of buffer (choice). status Status object (Status). IERROR Fortran only: Error status (integer). DESCRIPTION
MPI_File_read_ordered is a collective routine. This routine must be called by all processes in the communicator group associated with the file handle fh. Each process may pass different argument values for the datatype and count arguments. Each process attempts to read, from the file associated with fh, a total number of count data items having datatype type into the user's buffer buf. For each process, the location in the file at which data is read is the position at which the shared file pointer would be after all processes whose ranks within the group are less than that of this process had read their data. MPI_File_read_ordered returns the actual number of datatype elements read in status. The shared file pointer is updated by the amounts of data requested by all processes of the group. ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument. C++ func- tions do not return errors. If the default error handler is set to MPI::ERRORS_THROW_EXCEPTIONS, then on error the C++ exception mechanism will be used to throw an MPI:Exception object. Before the error value is returned, the current MPI error handler is called. For MPI I/O function errors, the default error handler is set to MPI_ERRORS_RETURN. The error handler may be changed with MPI_File_set_errhandler; the predefined error handler MPI_ERRORS_ARE_FATAL may be used to make I/O errors fatal. Note that MPI does not guarantee that an MPI program can continue past an error. Open MPI 1.2 September 2006 MPI_File_read_ordered(3OpenMPI)
All times are GMT -4. The time now is 02:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy