[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: React to File changes
Hi,
You don't say what the overlying OS is that the DOS program is
running under, but if it's NOT W2K,
mknod some_file p
then just have a program read from some_file. It's a pipe, and the
program will block until there is data available.
You might have to play with detecting "end of file" ( timeout on the
read after data, etc ).
I had this running as a communication method between DOS & Unix until
W2K was installed @ A clients. This completely broke it, as the
file would be deleted first, then overwritten ( no change to the actual
application, W2K was being very kind and doing more than it was asked! ).
You might have to play with permissions and such, but it worked for me!
The other option if you have source control of the DOS application is
the "magic" option ( grep for it , I can't remember the exact name ).
It is the name of a shell script that will automagically execute on the
unix when it's closed by the DOS application.
It's saved me in a few cases!
Cheers!
>
> I have this stupid DOS program that periodically writes a file to a
> directory on the file server(openBSD2.7 -stable, samba).
>
> The file is completely overwritten each time.
> When the file is written I need to grab the information from the file
> and send it to a database.
>
> Is it possible to write a bsd program that replaces the file as a
> sort of file type device daemon?
>
> That way when the DOS program writes to the file it is actually
> sending the information to a daemon?
> the problem I see with this is the DOS program overwrites the file
> each time. I don't know if a unix dev can be opened by a DOS program
> through a samba connection as a file for rewrite?
>
> Or would I be better off to just stick with a program that watches
> the file for changes like I have now?
>
> thanks, I hope . . .
> --
> Later . . . 'liam
>
> allenwc@home.com
> William C Allen, BLS, EET
>
> "It may be that your sole purpose in life is to serve as a warning to others"
> Unknown
>
--
Steve Williams, Calgary, Alberta, Canada
Genie Computer Systems Inc.
steve@genie96.com
"A man doesn't begin to attain wisdom until he recognizes that he is
no longer indispensable."
- Admiral Richard E. Byrd ( 1888-1957 )