|
-
Oct 25th, 2008, 10:06 AM
#1
[RESOLVED] Run into "chicken & egg" problem. Workaround?
Hello all,
I'm working on an application which when starts up, it'll read a config file which resides on a network share. However, the application does not know where this file is until it reads the contents of that file for the first time (then it save the file path for subsequence runs). The bad part is that this file can be moved from one server to another server, and everytime the file is moved, its contents is automatically changed to show where it currently is without human intervention.
So it's like the famous "chicken and egg" problem. To read the file, I must know where it is, but I can not tell where it is until I read it.
What I'm doing currently is to use another file (which is manually edited to record the current location of the config file) at a fixed location, and when the application starts up, if it can not find the config file from the path saved in My.Settings, it'll go to the fixed location file to get the correct path, read the config file, update My.Settings for the next run. This works, but it requires human intervention to edit the file at the fixed location, which can be out of sync at times (for example, on weekends, no one's at work to go in the file and change it should the config file get moved). And yes, I have no control over the application that moves the config file (it's a third party application not developed in house).
I'm open for any better ideas....
Thank you.
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|