- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need help!!!
I have four codes that solve a given problem by executing them in a sequential manner. Code 1 reads an input file and makes up some files to be input to code 2. Then code 2 reads the code 1 files and does some calculations and writes more files for code3. Then code 3 reads code 1 and code 2 files to write code 4 input files. And then code 4 reads everything and writes the final results file.
We now want to put these codes on a server so many people will have access to them to make calculations. This means there will be multiple copies of the codes running at the same time which will lead to the various intermediate files colliding with each other!!! This is my problem. Is there any way to solve this problem???
1. Can I put them all into a dll and write what I've been told are Win 32 API "Memory Files"?
2. Can anyone give me any advice to solve this problem??
Thank you,
John Wondra
john.wondra@l-3com.com
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. If all of these "codes" are in a single executable, open the file in code 1 with STATUS='SCRATCH' and don't close it until code 4 is done. This means keeping the unit number(s) open through the process.
2. Get the process ID (GetCurrentProcessID), convert that to a hex string, and use that to create a filename. If the server is a single system, you'll be guaranteed that no other process will be using the same name at the same time. If it's multiple servers sharing a disk, then you may need to qualify the name further with a system name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do they all need touse the same data files?
Could the data files be local (to the user) and only the executable files be on the server?
Les
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You did not indicate if the users were running via Terminal Server or via attached PC with file sharing to server.
Often an application is written to open files using the file name only 'DATA.DAT'. When doing so this implies the file resites in the Current Directory on the Current Disk Drive.
If each of your many users has there own input file, and if each of the final output files are kept seperate from the others (collated later), then the suggestion would be to have each user start the application (what you call codes) from seperate Current Directories. Example:
Launch a console window:
Start | Run | CMD
One time only create an application root directory (assume on C:) and create working directories for each of your users.
C:
CD
MD Wondra
CD Wondra
MD John
MD Jim
MD Moe
MD etc...
In C:Wondra insert your master batch file that runs your applications (your code programs)
One time only create a shortcut for each user which specifies their unique working directory (e.g. C:WondraMoe) and which launchesthe masterbatch file (e.g. C:Wondramaster.bat).
Now all the temp files and output file are created into seperate directories (seperate folders).
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page