RickD wrote:
Use FileOpen with FILE_READ parameter. If FILE_READ does not combine with FILE_WRITE, the file will be opened only if it already exists.
Marty73 wrote:
2. Is there a function that finds whether a particular file exists in a particular directory? Sort of like Dir?
2. Is there a function that finds whether a particular file exists in a particular directory? Sort of like Dir?
Use FileOpen with FILE_READ parameter. If FILE_READ does not combine with FILE_WRITE, the file will be opened only if it already exists.
Rick
What I've been doing so far is using FileOpen and if the handle number returns less than 0 then the file doesn't exist. I think you're suggesting a similar solution. It works but it's sloppy because it runs a nice string of error msgs in the debugger.
There is another way. Use Win32API FindFirstFile/FindNextFile.

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'm hoping someone can help me with these two issues:
1. How do I find Time[0] for 1H timeframe if my indicator is running in 5M timeframe for example?
2. Is there a function that finds whether a particular file exists in a particular directory? Sort of like Dir?
Thank you in advance
M