what I tend to do when awaiting a large file is send two files, the one you are interested in, followed by a very small one (a sentinel) for which I order a FileSystemWatcher. Don't rely on file datetime stuff, as it depends on the actual file system, which could be a USB stick (often FAT), a network disk (might be UNIX based), etc.
yup - used to call this technique 'sentinel file' - very handy for processing a large data file being FTP'd to you from a mainframe, you get the mainframe to send you a small sentinel file and wait for that to kick off further processing
As you'll see, there are all sorts of solutions, and as JSOP points out (iirc), the notifications you get depend on the application thats creating/? the file
One strategy I used (when not using 'Sentinel Files' as per my comment to Luc), was to queue a notification from FileWatcher, and then periodically see if I could get exclusive access to the file and/or combine the notification with a dir list check - if so, she's good to go, if not, wait a period - not sure if JSOP outlined that sort of strategy
In my case, I was using a "Concurrent Queue" to add file names to (by file watcher), and that a BGW "pops" and services. The BGW starts and stops based on entries in the queue. The queue can be serialized and reloaded at start-up; with an initial BGW started in the process.
The above scenario is used by field equipment to upload field reports to SharePoint; while online or to synch later.
if (i != j && i % j == 0)
isPrime = false;
It's a conditional statement: if the condition matches (i.e. i is not the same as j, and i is a multiple of j) then i is not prime, so it exits the inner loop - and the inner loop only. It still executes all the steps of the outer loop.
It's a very inefficient way to list all the primes up to one hundred, is all.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
Last Visit: 31-Dec-99 19:00 Last Update: 2-Dec-21 2:12