Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Launching a process based on file existence
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 4.0
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web Service
Divers
Thread ID:
01528855
Message ID:
01528892
Vues:
51
>Hello all,
>
>I wasn't sure how to classify this question, but I have a situation where I want to have a process (already written) run when a file is populated into a directory on my server. Basically, it is an import process that takes a file and loads it into the database. The file will be sent to the directory by partners via FTP.
>
>How should I create this? Should I create some kind of 'listener' process (if so, how is this accomplished?) that kicks off the import process when a file exists or create a console app that runs every minute or so and checks for the existence of said file in the directory and then run the import process when the file exists?
>
>If I do the latter, then this job will run over and over again to load a file that I get once a week.
>
>All suggestions are appreciated.
>

I have done this using a simple all-VFP solution. The form program includes a timer. Every time the timer fires it checks the target directory for target file(s). The directories and files are in a table, as are the names of the EXEs to run. It was straightforward, probably no more than a morning's work. Every process that was triggered was logged to another table, including start time and end time. After a certain elapsed time processes that had started and not finished were retriggered. The timer interval was 5 minutes or so, which isn't instant like the Windows event approach suggested by Craig and Bruce, but it was more than adequate for our purposes.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform