QUESTION - File Function - page 2

 
codersguru:

Yes you can access files anywhere with my DLL

You can download and find more details here:

MT4 Files Functions Replacement


Im using the gFile functions but Im having a problem with file clearing. I must delete the file and then call gFileOpen once again. But the library missing gFileCopy function which I need.

Is there some other ways how can I copy the file from local directory to another directory outside MetaTrader?

Thank you.

 
wackena:
I'm running Windows XP. "mklink" is for Vista and Windows 7. I believe "junction points" are for symlink in XP. I will need to review if there is a resource app to do this.
Don't need junction points except for directories. Just create a ntfs hard link for files. Create a batch file (I called it ln-h.bat) in a directory in your path.
@echo off&setlocal
set cl=%*& rem "&echo missing quote&exit/b
if     exist "%~2\*" (
    for /f "usebackq delims=/" %%A in (`dir /b %1`) do fsutil hardlink create "%~2\%%~nxA" "%%~A"
) else (
    if not exist %2 (
        for /f "usebackq delims=/" %%A in (`dir /b %1`) do fsutil hardlink create "%2" "%%~A"
    ) else dir %2
)
 
codersguru:
Yes you can access files anywhere with my DLL
See also File Operations via WinAPI - MQL4 Articles and File Operations without Limitations - MQL4 Code Base
 

Hi WHRoeder,

yes. I was tested a script with your dll's but I cannot clear the file. I need write into one file for more times. How can I cut the file to zero lenght?
Its ok when I save a line into the file with your functions. But the problem is while writting a new short string at the same line. The characters from previous string are not deleted.

How can I clear the file?

 
If you open the file FILE_WRITE|FILE_READ you can append. Open it FILE_WRITE and it's truncated. Just like the documentation says
 
codersguru:

Yes you can access files anywhere with my DLL

You can download and find more details here:

MT4 Files Functions Replacement



Hi Codersguru, These functions are no longer working in build 600. Can you please update when you get a chance. Thanks.

Reason: