how to read a file

General help with the eC language.
Post Reply
amigojapan
Posts: 7
Joined: Fri Jul 29, 2022 7:43 am

how to read a file

Post by amigojapan »

Code: Select all

      File f = FileOpen("3dplJSlib.js", read);
      if(f)
      {
         uint64 maxSize = f.GetSize();
         //byte * buffer = new byte[maxSize + 1];
         char * buffer = new byte[maxSize + 1];
         f.Read(buffer, 1, maxSize);
         buffer[maxSize] = 0;
         puts(buffer);
         delete f;
      }
Post Reply