I just figured out how to do it. For anyone with the same question, go with the MT path but add "FILE_COMMON" to your file handle flags when you write the file. This places the file in a shared folder making it accessible to other terminals.
LouK: int fileHandle=FileOpen("C:\Program Files\Metatrader\MetaTrader - 082\TESTFOLDER\TESTFILE.txt",FILE_READ|FILE_WRITE|FILE_TXT); |
File Read problem - MQL4 forum |
WHRoeder:
LouK: int fileHandle=FileOpen("C:\Program Files\Metatrader\MetaTrader - 082\TESTFOLDER\TESTFILE.txt",FILE_READ|FILE_WRITE|FILE_TXT); |
File Read problem - MQL4 forum |
But why deal with absolute paths when, as I said above, the FILE_COMMON flag automatically makes the file accessible to other terminals?
But out of curiosity, I'm not sure what you mean by the file doesn't exist. As I said in the original, I copied and pasted the path from the file Properties. Windows says it exists. Are you saying that MT disagrees? Like some alternative reality?
LouK:But out of curiosity, I'm not sure what you mean by the file doesn't exist.
| With out the common flag open("xxx/yyy") means open the file "c:\...MQL4\files\xxx\yyy" so open("c:\...\mql4\files\xxx\yy") means open the file "c:\...\mql4\files\c:\...\mql4\files\xxx\yyy" and there is no such file "c:\...\mql4\files\c:\...\mql4\files\xxx\yyy" |

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I can read and write files OK in one terminal, but they appear to be filed relative to the terminal. I want to be able to read a common file from any terminal/account.
Can anyone show me in the 600 build how to file an absolute path or otherwise access a common file from other terminals/accounts?
I've tried to open this path, which I copied and pasted from the file Properties, but MT won't open it:
int fileHandle=FileOpen("C:\Program Files\Metatrader\MetaTrader - 082\TESTFOLDER\TESTFILE.txt",FILE_READ|FILE_WRITE|FILE_TXT);
Thanks!