How to know a file is of fixed file or not over a span of time Actually my requirement is to check the size of the file in a specific directory for 60 seconds, and if it remains the same then I have to move to some other directory.Else I have to stop the execution. Request you to guide me in knowing the varying size of the file.
I got to know to calculate the file size with the following code:
How can I perform size check of any character file(which switch)?
For example: I have to perform certain actions if file size is not zero. How can I do that?
Is this syntax fine?
if test ! -z $filename
then
fi (2 Replies)
Hi All,
I am in small problem..
i have one script which transfers some big files to my ftp usign normal command like put ....
my problem is how to check whether my file have been transferred successfully on ftp or not...
i know only inside ftp we have option like 'size' command which... (2 Replies)
I have following script on AIX/KSH
if ] ; then
echo "filename exists and is > 0 bytes"
else
echo "filename does not exist or is zero length"
fi
It is not working. What is wrong here??? (3 Replies)
Hi,
Am trying to execute certain commands if the condition satisfied, but i feel i am making some mistakes in the usage of if statement
here is the code
#!/bin/ksh
SIZE=$(ls -ltr /aemu/ws/DN.txt | tr -s ' ' | cut -d ' ' -f 5)
filename=`TZ=CST+24 date +%Y%m%d`
ZERO=0
if
then
cp... (5 Replies)
Hello,
I have two servers A and B, My script is written on Server A. I am picking up the file say "abc.txt" from Server B using sftp command and putting it in a directory at Server A.
Now the catch is, If the file size of "abc.txt" is greater thn the available size on Server A, thn an email... (1 Reply)
I want to write a batch job (ksh) with the following requirement
we have file feeds coming to our system from other team,
if the file size is greater than expected then we dont need to process the file for the day
and need to archive the file and send email notification to the manager saying... (5 Replies)
if ; then
cp /tmp/testfolder/*.* ~/new/logs/
else
echo "No files today"
exit
fi
The problem is this doen't work when there is more than 1 file. Please tell me how to
take the latest file and check the size of the file in a directory (1 Reply)
I am trying to check whether two files are empty or not using below if condition but its checking for only one file
if ]
Again I tried
if && ]
Need your assistance (2 Replies)
Discussion started by: Aditya_001
2 Replies
LEARN ABOUT DEBIAN
lfc_readdirxr
LFC_READDIRXR(3) LFC Library Functions LFC_READDIRXR(3)NAME
lfc_readdirxr - read LFC directory opened by lfc_opendir in the name server
SYNOPSIS
#include <sys/types.h>
#include "lfc_api.h"
struct lfc_direnrep *lfc_readdirxr (lfc_DIR *dirp, char *se)
DESCRIPTION
lfc_readdirxr reads the LFC directory opened by lfc_opendir in the name server. This routine returns a pointer to a structure containing
the current directory entry (basename, guid and filesize) and the replica information.
struct lfc_rep_info {
u_signed64 fileid;
char status;
char *host;
char *sfn;
};
struct lfc_direnrep {
u_signed64 fileid;
char guid[CA_MAXGUIDLEN+1];
mode_t filemode;
u_signed64 filesize;
int nbreplicas;
struct lfc_rep_info *rep; /* array of replica info structures */
unsigned short d_reclen; /* length of this entry */
char d_name[1]; /* basename in variable length */
};
lfc_readdirxr caches a variable number of such entries, depending on the filename size, to minimize the number of requests to the name
server.
dirp specifies the pointer value returned by lfc_opendir.
se allows to restrict the replica entries to a given SE.
RETURN VALUE
This routine returns a pointer to a structure containing the current directory entry if the operation was successful or NULL if the end of
the directory was reached or if the operation failed. When the end of the directory is encountered, serrno is not changed. If the operation
failed, serrno is set appropriately.
As lfc_readdirxr returns a null pointer both at the end of the directory and on error, an application wishing to check for error situations
should set serrno to 0, then call lfc_readdirxr, then check serrno and if it is non-zero, assume an error has occurred.
ERRORS
EBADF File descriptor in DIR structure is invalid.
ENOMEM Memory could not be allocated for unmarshalling the reply.
EFAULT dirp is a NULL pointer.
EINVAL The length of se exceeds CA_MAXHOSTNAMELEN.
SECOMERR Communication error.
ENSNACT Name server is not running or is being shutdown.
SEE ALSO lfc_closedir(3), lfc_opendirg(3), lfc_rewinddir(3)AUTHOR
LCG Grid Deployment Team
LFC $Date$ LFC_READDIRXR(3)