In my application I have a process which picks the scanned
files (tif format) from a shared location and it links to
application and shown on it.The actuall issue is that my
process picks the file before it is completly written or
scanned which results in displaying few parts of the image
or incomplete image.I need to check if the file is not
completly scanned or written then do not link it to
application.Please help if any body tell me that how can i
check that file is in written phase or locked through
DTS.thanking you in advance
Answer Posted / Avanish Kumar Pandey
To prevent your process from picking incomplete TIFF files, you can implement the following approach:
1. Use File System Watcher or a similar technology to monitor changes in the shared location for new files and wait until the file's last write time remains unchanged for a certain period (e.g., 5 minutes) before picking it up.
2. You can check if the TIFF file is locked by scanner software using APIs provided by your application or by using the `File.Exists` method in C# to ensure the file is not being accessed by another process.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What kind of problems occurs if we do not implement proper locking strategy?
What are the risks of storing a hibernate-managed object in a cache? How do you overcome the problems?
If any stored procedure is encrypted, then can we see its definition in activity monitor?
What is the difference between for xml raw and for xml auto?
What are the properties of the transaction?
What is in place upgrade in sql server?
Why should you use or avoid select * statements?
This question asked during interview, 2) At the end of each month, a new table is created for each bank that contains monthly metrics consolidated at the account level. The table naming convention is bankX_YYYYMM where X represents the numeric designation of the bank and YYYYMM indicates the 4 digit year and 2 digit month. The tables contain the following fields: name data type description account text account number registered boolean indicates whether the account is registered num_trans integer number of transactions made during the time period spend numeric(9,2) total spend during the time period a) Write a SQL query that will display the total number of transactions and total spend for "Bank1" during the 4th quarter of 2009. b) Write a SQL query that will display the total number of transactions and total spend at "Bank1" and "Bank2", broken out by registered vs. non-registered accounts, during January 2010 not sure what is correct answer and how to solve?
What are different types of constraints?
What is a coalesce function?
How can you append an identity column to a temporary table?
Can one drop a column from a table?
How efficient you are in oracle and SQL server?
How to connect php with different port numbers?
List out the different types of locks available in sql server?