ara1
1
I have read the help files and the references on this site, but something escapes me.
I want to delete files in a directory, before I update my data.
The code below searched the desired directory and find the files I want to delete.
When I extract the file name and use it with fdelete(), the files remain intact.
The results from the trace statement also below

File_path = "G:\\DataFiles\\Amibroker-EOD\\DailyProcessedData\\";
//
//
if( Status( "stocknum" ) == 0 )
{
List = fdir( file_path + "*.*", 1 );
//
//Delete old files
for( i = 0; ( filename = StrExtract( List, i ) ) != ""; i++ )
{
filedelete = fdelete( filename );
_TRACE( "stoc#-del - i " + writeval( i, 1.0 ) + " fname " + filename + " status " + WriteVal( filedelete, 1.0 ) );
}
}
fxshrat
2
You have not read documentation properly. Your file path is not AmiBroker installation folder.
Besides someone else had same issue as you already. So you have not used forum search (properly too)...
So if files are not located in AB installation folder then you need to add path to fdelete but not just file name.