How to determine when file is created 
Author Message
 How to determine when file is created

Hi All,

I have a requirement to be able to determine when a file has been
created in a specific directory on a Windows 98 PC.

The file is actually created on one machine (VME based, OS/9) and then
copied over a network to a directory on another machine (PC, Windows
98). I need to know when the file copy has finished so that another
application (on the PC) can pick it up and process it.

Any ideas?



Mon, 04 Apr 2005 22:29:41 GMT  
 How to determine when file is created


Quote:
> Hi All,

> I have a requirement to be able to determine when a file has been
> created in a specific directory on a Windows 98 PC.

> The file is actually created on one machine (VME based, OS/9) and then
> copied over a network to a directory on another machine (PC, Windows
> 98). I need to know when the file copy has finished so that another
> application (on the PC) can pick it up and process it.

> Any ideas?

No. I can't think of a way to do this without platform specific extensions
that ISO C knows nothing about. Try a newsgroup that has your platform(s)
as a topic?


Mon, 04 Apr 2005 22:36:06 GMT  
 How to determine when file is created

Quote:

> Hi All,

> I have a requirement to be able to determine when a file has been
> created in a specific directory on a Windows 98 PC.

> The file is actually created on one machine (VME based, OS/9) and then
> copied over a network to a directory on another machine (PC, Windows
> 98). I need to know when the file copy has finished so that another
> application (on the PC) can pick it up and process it.

> Any ideas?

while ((f = fopen("file", "rb")) == NULL || fclose(f))
   ;

Don't take this too seriously. It *could* work.

Jirka



Mon, 04 Apr 2005 22:49:30 GMT  
 How to determine when file is created


Quote:


>> Hi All,

>> I have a requirement to be able to determine when a file has been
>> created in a specific directory on a Windows 98 PC.

>> The file is actually created on one machine (VME based, OS/9) and then
>> copied over a network to a directory on another machine (PC, Windows
>> 98). I need to know when the file copy has finished so that another
>> application (on the PC) can pick it up and process it.

>> Any ideas?

>No. I can't think of a way to do this without platform specific extensions
>that ISO C knows nothing about. Try a newsgroup that has your platform(s)
>as a topic?

Platform specific extensions?  What's wrong with simply using a second
"dummy" file, whose presence or absence indicates the status of the copy
operation?  You could, say, have whatever mechanism does the copying over
the network also create a dummy file when the copy is finished (and not
initiate a copy operation while the dummy file already exists), and
have whatever mechanism on the PC consumes the data file delete the
dummy file after it is done consuming the data (and not initiate
consumption of the data until the dummy file is present).  This is pretty
basic stuff, and no extensions are needed (for this part).

--Ben

--



Tue, 05 Apr 2005 03:04:19 GMT  
 How to determine when file is created


Quote:
>>> I have a requirement to be able to determine when a file has been
>>> created in a specific directory on a Windows 98 PC.

>>> The file is actually created on one machine (VME based, OS/9) and then
>>> copied over a network to a directory on another machine (PC, Windows
>>> 98). I need to know when the file copy has finished so that another
>>> application (on the PC) can pick it up and process it.

>>> Any ideas?

>>No. I can't think of a way to do this without platform specific
>>extensions that ISO C knows nothing about. Try a newsgroup that has your
>>platform(s) as a topic?

> Platform specific extensions?  What's wrong with simply using a second
> "dummy" file, whose presence or absence indicates the status of the copy
> operation?

I mis-read "when created" as "the creation timestamp." This is typical for
me.


Tue, 05 Apr 2005 03:35:53 GMT  
 How to determine when file is created


Quote:


>>>> I have a requirement to be able to determine when a file has been
>>>> created in a specific directory on a Windows 98 PC.

>>>> The file is actually created on one machine (VME based, OS/9) and then
>>>> copied over a network to a directory on another machine (PC, Windows
>>>> 98). I need to know when the file copy has finished so that another
>>>> application (on the PC) can pick it up and process it.

>>>> Any ideas?

>>>No. I can't think of a way to do this without platform specific
>>>extensions that ISO C knows nothing about. Try a newsgroup that has your
>>>platform(s) as a topic?

>> Platform specific extensions?  What's wrong with simply using a second
>> "dummy" file, whose presence or absence indicates the status of the copy
>> operation?

>I mis-read "when created" as "the creation timestamp." This is typical for
>me.

But even if this were the question, it could still be addressed using
portable C, by writing the time in question to a separate file rather than
using the filesystem timestamps.  This might even be preferable, e.g., in
cases where the files might be subject to archiving, which might munge the
timestamps, or where the timebase on the PC cannot be trusted (very common
problem, amazing to me how poor the typical PC clocks are (hard to believe
they can really save much money with whatever horrific R/C kluge they use,
vis a vis using a highly-accurate quartz circuit as found in wris{*filter*}ches,
surely costing less than 2$ wholesale): thank goodness for xntpd!).

--Ben

--



Tue, 05 Apr 2005 04:05:34 GMT  
 How to determine when file is created
Thanks for the feedback. I had thought about creating a dummy file but
I wondered if there was a more "elegant" solution. Sorry if some parts
of this were OT, it's my first time here.

Cheers,
John



Tue, 05 Apr 2005 16:28:12 GMT  
 How to determine when file is created

Quote:
> I have a requirement to be able to determine when a file has been
> created in a specific directory on a Windows 98 PC.

> The file is actually created on one machine (VME based, OS/9) and then
> copied over a network to a directory on another machine (PC, Windows
> 98). I need to know when the file copy has finished so that another
> application (on the PC) can pick it up and process it.

Note that "when the file is created" is not necessarily the same
as "when the copy is finished".  Most of the methods I know of
for copying to W98 (and most other systems, for that matter) first
create the (empty) file, and then copy into it; and trying to read it
during the copy will either fail or get incomplete (wrong) data.

In addition to the create-a-marker-file idea already discussed,
another possibility in at least some situations is:
- copy to a file with one name, say X, which is NOT looked for
- when the copy completes, (remotely) rename X to Y, which
IS looked for by the target app

For simplicity you can always use the same value for X,
e.g. "TMPCOPY.TMP".

On all filesystems I know of, and certainly W98, rename is
sufficiently atomic that by the time you can see the new name
you can use it.

--
- David.Thompson 1 now at worldnet.att.net



Fri, 08 Apr 2005 10:08:40 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. C# , i am trying to create a file on the server using C#

2. Determine where I am running

3. Am I creating new threads or ultra waste???

4. I am creating a new query using ADOX and no matter

5. I am new to programming and am lost

6. Determine messages created with RegisterWindowMessage()

7. Dynamically determining which view to create on document open

8. Dynamically determining which view to create on document open

9. Determining when a volume was created...How?

10. Determining in what assembly an object was created?

11. i am unable to read from a file having 26ascii character(ctrl+z)

12. a very simple problem about # include files but i am a beginer

 

 
Powered by phpBB® Forum Software