[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 183

 
alsu:
What's wrong with the standard FileXXXXX functions?

I need to work outside the terminal folders and I'm trying to do that, I haven't found a more or less compact and working code on the site, I'm picking up the pieces. I have Win7 and everything I found either works on XP or Vista. If you have a link or your own experience I would be grateful. I've been struggling for a long time...
 
merkulov.artem:

Need to work outside the terminal folders and I'm trying to do it, I haven't found any less compact and working code on the site, I'm picking up the pieces. I have Win7 and everything I found either works on XP or Vista. If you have a link or your own experience I would be grateful. I have been suffering for a long time...

Proven scheme:

1.Open a terminal (cmd), type the command mklink /?

2. Read the displayed help.

3.Create inside the experts/files folder a symbolic link to a location where you want to write/read files.

4. use it for a hundred years)

This only works on NTFS, if you have FAT32 disks then fail

 

example (inside files , a symbolic link-folder is created which leads directly to the root of the c drive):

>cd c:\MetaTrader\experts\files
>mklink /D disk_c c:\
 
The main thing is don't delete the link with explorer)))) it doesn't understand such jokes. TotalCommander or FAR will do it right.
 

all have the standard CLOSE script. It closes the first open trade. I thought that if I made it into an Expert Advisor, it would close all trades one by one.

I have looked at the structure - it is no different from Expert Advisor.

moved it to the folder "Expert Advisors" - I thought it would be executed not once but in a loop - but... it doesn't work.

please advise how (internally) the Expert Advisor is different from the script?

 
lottamer:

all have the standard CLOSE script. It closes the first open trade. I thought that if I made it into an Expert Advisor, it would close all trades one by one.

I have looked at the structure - it is no different from Expert Advisor.

moved it to the folder "Expert Advisors" - I thought it would be executed not once but in a loop - but... it doesn't work.

do you know the (internal) differences between the Expert Advisor and the script?


remove

#property show_confirm
 
merkulov.artem:
Better use CreateFile and the like. much more convenient, but more complicated too.
 
alsu:

example (inside files a symbolic link-folder is created which leads directly to the root of the c-drive):



Can you elaborate on this, it's interesting. I just open a command line:mklink /? Next is the help:

MKLINK [[/D] | [/H] | [/J]] Link Assignment


/D Creates a symbolic link to the directory.

The default is to create a symbolic link to a file.

/H Create a hard link instead of a symbolic link.

/J Creating a connection for a directory.

Link New symbolic link name.

Destination The path (relative or absolute) to which the

new link.

I need to use /D. It says ""/D" is not an internal or external command, executable or batch file.".

Maybe I'm doing something wrong, I just have the terminal on drive k, I specified it.

 
Does anyone have their own code for mql4 that you use to work with files outside the terminal, I only need to write and read. I have Win7 x64. MT4 build 451.
 
merkulov.artem:



I gave an example above, try typing it into the command line and see what happens. Only specify your own path to the MT.
Reason: