Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Mutual file sharing with 2 or more CVF files
Hello all. I've been trying to get 2 CVF programs to interface with
each other through shared text files.

Basically:
1) Program 1 writes some data to a text file;
2) Program 1 executes Program 2 through the systemqq('Program2.exe')
command;
3) Program 2 reads the text file (in theory)
4) Program 2 modifies the text file (in theory)
5) Program 1 re-reads the modified text file.

Unfortunately I get this error:

"forrtl: The process cannot access the file because it is being used
by another process."

and I think it is because of a sharing violation between the 2
programs. Since the programs don't need to access the files
simultaneously (they access it in turn) how do I get these 2 programs
to work?

Also, is there a way of directly transferring the output of one
program into the input of another (without shared files, etc)?

Thanks

Report this thread to moderator Post Follow-up to this message
Old Post
justabeginner
10-12-04 01:56 AM


Re: Mutual file sharing with 2 or more CVF files
nom_de_plume79@yahoo.co.uk (justabeginner) wrote:
>Hello all. I've been trying to get 2 CVF programs to interface with
>each other through shared text files.
>
>Basically:
>1) Program 1 writes some data to a text file;
>2) Program 1 executes Program 2 through the systemqq('Program2.exe')
>command;
>3) Program 2 reads the text file (in theory)
>4) Program 2 modifies the text file (in theory)
>5) Program 1 re-reads the modified text file.
>
>Unfortunately I get this error:
>
>"forrtl: The process cannot access the file because it is being used
>by another process."
>
>and I think it is because of a sharing violation between the 2
>programs. Since the programs don't need to access the files
>simultaneously (they access it in turn) how do I get these 2 programs
>to work?

In Program 1, after writing to the file in step 1, CLOSE the file.

>
>Also, is there a way of directly transferring the output of one
>program into the input of another (without shared files, etc)?

Use a pipe, a concept well-known in Unix but also available on DOS/Windows.
If your executables are 1.exe and 2.exe, typing

1.exe | 2.exe

uses the standard output of 1.exe as input to 2.exe .



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==--
--
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 News
groups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =
---

Report this thread to moderator Post Follow-up to this message
Old Post
beliavsky@aol.com
10-12-04 01:56 AM


Re: Mutual file sharing with 2 or more CVF files
Hi beliavsky. Thanks for your input. I implemented the close
statements into my DO loop and everything works perfectly.

Good idea about the pipe, I'll look into it. Do you know if it is
possible to have an iterative pipe where prog1.exe & prog2.exe
continuously return data to each other? It looks like if you invoke a
pipe at the command prompt it would be a one-off thing.

Thanks.

Report this thread to moderator Post Follow-up to this message
Old Post
justabeginner
10-13-04 08:56 AM


RE: Mutual file sharing with 2 or more CVF files
In a previous article, nom_de_plume79@yahoo.co.uk (justabeginner) wrote:
>Hi beliavsky. Thanks for your input. I implemented the close
>statements into my DO loop and everything works perfectly.
>
>Good idea about the pipe, I'll look into it. Do you know if it is
>possible to have an iterative pipe where prog1.exe & prog2.exe
>continuously return data to each other? It looks like if you invoke a
>pipe at the command prompt it would be a one-off thing.
>
>Thanks.
I wonder if you could set up a handshake - e.g. the || port
could be accessed by both programs and (SPP anyway) is
read/write - that each program can use to signal the other
that data are ready in file xxxx. Tricky - but entertaining.
Chris

Report this thread to moderator Post Follow-up to this message
Old Post
meek@skyway.usask.ca
10-13-04 08:59 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Fortran archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:46 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.