File Cant open/read file from common directory ?

 

Hello i am trying to read a file from the common directory but its not working 

Here is the code that i am trying :


input string FileName="15767168";
string Directory=TerminalInfoString(TERMINAL_COMMONDATA_PATH);  
 
void OnInit()
  {
 
   ResetLastError();
   int file_handle=FileOpen(Directory+"//"+FileName,FILE_READ|FILE_ANSI);
   if(file_handle!=INVALID_HANDLE)
     {
      int    str_size;
      string str;
 
      while(!FileIsEnding(file_handle))
        {
          str_size=FileReadInteger(file_handle,INT_VALUE);
          str=FileReadString(file_handle,str_size);
          PrintFormat(str);
        }
       FileClose(file_handle);
      PrintFormat("Data is read, %s file is closed",FileName);
     }
   else
      PrintFormat("Failed to open %s file, Error code = %d",FileName,GetLastError());


I receive this error :  Failed to open 15767168 file, Error code = 5002


I tried looking here : RunTime Errors  to see if I can find out why its giving the error , but all it says about the error 5002 is  " Wrong file name " where as the file name is exactly as what i used in the code 


whats the cause of this error and can someone please guide me how i can solve it ?


Thank you