Sponsored Content
Top Forums Shell Programming and Scripting Copy/move file which are not currently in use. Post 302373911 by matrixmadhan on Monday 23rd of November 2009 12:28:08 AM
Old 11-23-2009
Quote:
Originally Posted by ghostdog74
one way,
reprogram your mainframe code that copied the files to your local to include a dummy file that signifies copying is done. Then you can just check for that done file in your shell script.
In most of the cases, like this, the system are completely decoupled with different assigned owners with different teams, so a consumer team ( receiving files ) is very hard / difficult to change the format/procedure with respect to the producer. Main reason could be,
  1. 1) they don' t want to change simply
  2. 2) producer might be catering to multiple consumers altogether


---------- Post updated at 10:58 AM ---------- Previous update was at 10:56 AM ----------

Check for lsof command as well.
It will show the valid process id attached to a file handle. Probably, if a file is being still copied then process id of the 'copy' process should be intact with the file handler of the file being copied
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to copy/move folder on XP to Solaris?

I have created a folder on C:\images\Raffles.jpg on my PC, and I like to copy or move to Solaris server. How can I do that? Please advise. Thanks in advance. (2 Replies)
Discussion started by: simt
2 Replies

2. Shell Programming and Scripting

Help with Copy Move Script

Hello Gurus! Please help! I would like to get some help with the following: I'm working right now on a Data Warehouse project and I need to automate a manual procedure I am using to process the data files coming into the database, any information/ideas and or which script language to go... (4 Replies)
Discussion started by: alfpathros
4 Replies

3. Shell Programming and Scripting

ncftp copy/move pb

Hi, i have made this script for copy file in folder FTP in my local machine, when copy is finish i move files copied in backups_001 directory on same ftp 1°) the problem is if this script works with date if date is similar i taken, but if one day in ftp they put new file is no getting ... (0 Replies)
Discussion started by: livetele
0 Replies

4. Shell Programming and Scripting

Bash Copy-Move file problem

Hello, I made a script to copy files from one directory to another and move file after the copy is done. When files are present in the source directory there is no problem but when no file are present I'm getting an error. Please help !! --------------------- #!/bin/bash ... (2 Replies)
Discussion started by: lsimoneau
2 Replies

5. UNIX for Dummies Questions & Answers

How to copy/move to a file with a special character as the 1st char in the filename?

I am trying to create files with special characters in its filenames for testing purposes. This is on a Linux RHEL4 but this should also be applicable on a Unix shell. I am able to create files with special characters in the filenames...e.g. cp -pv foo.gif \*special.gif cp -pv foo.gif \... (6 Replies)
Discussion started by: sqa777
6 Replies

6. UNIX for Dummies Questions & Answers

help pls! need to move and copy pattern...

Help please... Need to convert below: Subcase ID : 10001 210000 0 1.22049E+01 220000 0 6.29560E+00 Subcase ID : 20703 210000 0 2.76398E+00 220000 0 2.43183E+00 230000 0 -1.87728E+01 Subcase ID : 13703 210000 0 ... (2 Replies)
Discussion started by: lakanino
2 Replies

7. UNIX for Dummies Questions & Answers

Unable to copy or move file

I am trying to move a file that is in the root directory. I suspect it is an old file created by someone when the system was installed. I am testing accessing the file by doing a copy but the command does not find the file. I am operating as root. We are HP-UX B.11.23 I do long listing and... (3 Replies)
Discussion started by: phcorn
3 Replies

8. Shell Programming and Scripting

Copy or Move problem

Hi All, I have a simple shell script to move .txt file(s) from a source directory one after another to the destination. The source directory is shared to windows using samba. The source files are arriving continuously and approx size is 10-15 KB. Some time the file size reached upto 100 KB and... (9 Replies)
Discussion started by: sraj142
9 Replies

9. Solaris

Can't erase/move/copy file!

Hey everyone!. I have a problem with a file that doesn't allow any operation on it. I can't rm,mv,cp nor any other operation to it, I get the following errors: bash-2.05# mv ora_2527.aud /bkp mv: cannot access ora_2527.aud bash-2.05# cp ora_2527.aud /bkp cp: cannot access ora_2527.aud... (4 Replies)
Discussion started by: dragonov7
4 Replies

10. Red Hat

Separate the apache user file and move or copy some were

Hi all, I'm Using Centos 6.4 /opt/my_aplication/entry/data/0/ There are Thousands of files in this Directory, Only i need to copy or move the apache User's file from this to /tmp/backup , I have listed apache user's file using find . -user apache -type f , its gave me the only apache... (2 Replies)
Discussion started by: babinlonston
2 Replies
XpGetDocumentData(3Xp)						 XPRINT FUNCTIONS					    XpGetDocumentData(3Xp)

NAME
XpGetDocumentData - Creates and initializes a new print context. SYNOPSIS
cc [ flag... ] file... -lXp [ library... ] #include <X11/extensions/Print.h> Status XpGetDocumentData ( data_display, context, save_proc, finish_proc, client_data ) Display *data_display; XPContext context; XPSaveProc save_proc; XPFinishProc finish_proc; XPointer client_data; ARGUMENTS
data_display Specifies a pointer to the Display structure; returned from XOpenDisplay. context The print context from which document data is to be retrieved. save_proc A procedure to be registered and called repeatedly to save blocks of document data. finish_proc A procedure to be registered and called once when the print job has completed and all document data has been sent to save_proc. client_data Specifies client data to be passed to save_proc and finish_proc when called. DESCRIPTION
XpGetDocumentData registers callbacks that allow a "consumer" to continuously retrieve document data generated in the X Print Server by a separate "producer", where both are referencing the same print context by way of different display connections. Though XpGetDocumentData retrieves document data, its effect is bounded by XpStartJob and XpEndJob. XpGetDocumentData always returns immediately; if an error occurs and the callbacks cannot be registered, the return status is 0, else the return status is non-zero and the callbacks will be called some- time after the return from XpGetDocumentData. This producer/consumer exchange is set up when XpStartJob is called by the producer with out- put_mode equal XPGetData, and is subsequently initiated when XpGetDocumentData is called by the consumer. Though XpStartJob will return immediately, further attempts to use the producer's display connection may be blocked by the X Print Server until XpGetDocumentData is called on the consumer's display connection. Following a successful call to XpGetDocumentData, the consumer must enter a loop to process events from the server, for example, by calling XNextEvent. The event processing code will invoke save_proc and finish_proc as needed to consume incoming data. To avoid blocking indefi- nitely in XNextEvent, the consumer should select for XPPrintNotify events, and watch for XPEndJobNotify. This event will be sent following the call to finish_proc and the consumer can safely exit the loop at this point. Aside from this processing of XPrintNotify events, data_display must not be used for any additional X requests until finish_proc is called and returns. STRUCTURES
The save_proc is defined in <X11/extensions/Print.h> as: typedef void (*XPSaveProc)( Display *data_display, XPContext context, unsigned char *data, unsigned int data_len, XPointer client_data); The save_proc is repeatedly called on each chunk of document data sent by the X Print Server until either XpEndJob or XpCancelJob is called. data_len specifies the number of bytes in data. The memory for data itself is owned by the library, so save_proc should copy data to another location before returning. After the last block of data has been delivered to save_proc, finish_proc is called with final sta- tus. The finish_proc is defined in <X11/extensions/Print.h> as: typedef void (*XPFinishProc)( Display *data_display, XPContext context, XPGetDocStatus status, XPointer client_data); After XpGetDocumentData successfully registers the callbacks, any generated X errors (for example, BadAlloc) or Xp errors (for example, XPBadContext or XPBadSequence) that are the result of XpGetDocumentData will cause the Xlib error handler to be invoked, and then will cause finish_proc to be called with a status of XPGetDocError. Any other activities (for example, a separate process destroying the print context) that prove fatal to the progress of XpGetDocumentData will also cause finish_proc to be called with a status of XPGetDocError. If XpGetDocumentData is called prior to XpStartJob, then an XPBadSequence error is generated and finish_proc is called with XPGetDocError. If XpGetDocumentData is called after XpStartJob and output_mode was specified as XPSpool, then an XPBadSequence error is generated and fin- ish_proc is called with XPGetDocError. If the producer starts generating data and the consumer cannot consume data quickly enough, then the producer's display connection will be blocked by the X Print Server. Until XpEndJob or XpCancelJob is called, it is possible that various XPPrintNotify events will be generated (for example, a page has been canceled). The data passed to save_proc is not necessarily organized according to the consumer's requests or any generated events, and its consistency is guaranteed only if the entire job completes successfully (i.e. without being canceled or generating an error). When finish_proc is called, sometime after XpGetDocumentData is called and returns, status gives the completion status of the job and is defined in <X11/extensions/Print.h> as: #define XPGetDocFinished 0 /* normal termination */ #define XPGetDocSecondConsumer 1 /* setup error */ #define XPGetDocError 2 /* progress error */ XPGetDocFinished indicates that all intended document data has been delivered by way of save_proc. All cancellation events are guaranteed to have arrived by the time finished_proc is called, and they should be taken into consideration for evaluating the validity of the docu- ment data returned. XPGetDocSecondConsumer indicates that a consumer had already been established for the print context. The X Print Server only supports one consumer per print context. XPGetDocError indicates that an error has been generated (for example, XPBadContext or XPBadSequence) and that no further document data will be delivered by the X Print Server to save_proc. After finish_proc returns, save_proc and finish_proc are unregistered and will no longer be called. DIAGNOSTICS
XPBadContext A valid print context-id has not been set prior to making this call. XPBadSequence The function was not called in the proper order with respect to the other X Print Service Extension calls (for example, XpGetDocumentData prior to XpStartJob). SEE ALSO
XpCancelJob(3Xp), XpEndJob(3Xp), XpStartJob(3Xp) X Version 11 libXp 1.0.0 XpGetDocumentData(3Xp)
All times are GMT -4. The time now is 07:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy