473,386 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Does the file REALLY exist

I'm looking at a directory into which files will be copied asyncronously by a
user. If a file takes some time to copy, it is possible to detect the file
before the copy has finished. If I try to process the file, an exception is
thrown. How can I determine if the file is REALLY there and ready to be
processed?

Thanks in advance,
Tom Costanza MCP
Mar 24 '06 #1
2 1082
Attempt to open the file with a lock for exclusive access.

If the file copy has not yet finished then your operation will throw an
exception.
"Tom Costanza" <ma*****@hotmail.com> wrote in message
news:BA**********************************@microsof t.com...
I'm looking at a directory into which files will be copied asyncronously
by a
user. If a file takes some time to copy, it is possible to detect the
file
before the copy has finished. If I try to process the file, an exception
is
thrown. How can I determine if the file is REALLY there and ready to be
processed?

Thanks in advance,
Tom Costanza MCP

Mar 24 '06 #2
Hi!

I always try first to rename the file.

Wolfgang

"Tom Costanza" <ma*****@hotmail.com> schrieb im Newsbeitrag
news:BA**********************************@microsof t.com...
I'm looking at a directory into which files will be copied asyncronously
by a
user. If a file takes some time to copy, it is possible to detect the
file
before the copy has finished. If I try to process the file, an exception
is
thrown. How can I determine if the file is REALLY there and ready to be
processed?

Thanks in advance,
Tom Costanza MCP

Mar 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: ben | last post by:
Hello, This really drives me nuts. Im opening an input file, and Im testing if it was open successfully. Thats it! I know that the file that Im trying to open DOES NOT exist but Im getting NO...
2
by: Steven T. Hatton | last post by:
I'm still not completely sure what's going on with C++ I/O regarding the extractors and inserters. The following document seems a bit inconsistent:...
2
by: mal hit | last post by:
We developed an ASP.NET application on Windows 2000/SQL Server 2000/IIS 5.0. Recently, we moved the SQL Server 2000 database to Windows 2003. Now, we are unable to connect to the database (on...
0
by: Dirk Försterling | last post by:
Hi all, a few days ago, I upgraded from PostgreSQL 7.2.1 to 7.4, following the instructions in the INSTALL file, including dump and restore. All this worked fine without any error (message). ...
11
by: Nick | last post by:
This is really starting to piss me off. Someone please prove me wrong. Here is a link to the function in DX 9 sdk....
16
by: lawrence k | last post by:
I've a file upload script on my site. I just now used it to upload a small text document (10k). Everything worked fine. Then I tried to upload a 5.3 meg Quicktime video. Didn't work. I've...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
4
by: SteveW | last post by:
Thanks to some good help from a previous post, I have been able to create well formed xml as part of a report logger app. However, I still have a small problem. When I add new xml to the log file,...
3
by: Mike | last post by:
Thanks for the reply, I have been trying that, but I keep getting the same results. The result I get is that the file exits, when it really doesn't. All my msgbox display twice and I'm not sure...
19
by: Angus | last post by:
I have a socket class CTestClientSocket which I am using to simulate load testing. I create multiple instances of the client like this: for (int i = 0; i < 5; i++) { CTestClientSocket* pTemp...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.