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
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:
Code:
n=1
while ($n=1)
do
Input_File= FileA.txt
Copy_File= FileB.txt
cp $Input_File $Copy_File
>$Input_File
#Post above steps i process the data in FileB.txt with my filthy code
done
Moderator's Comments: | ||
|