How to write a text file without a CRLF? lazarus / 61-Beginners ---------------------------------------------------------------------- bulrush · 2016-06-04 18:40 I need my app to make a file called "mimetype" for making an EPUB book, if the file doesn't exist. This file has only one line with no CRLF at the end. I tried using a cmd via RunCommand but the compiler says RunCommand is deprecated. I'd like to make this usable under any OS. Also the RunCommand failed. This was the command: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i mimetype  Now I notice the cmd above is Windows-specific, which I shouldn't do. I'd like the program to automatically make this file (because it's critical) just in case the user deletes it. If I use TStringList.SaveToFile(fn) will it put a CRLF at the end of the one line? Or what other method should I use? Thank you! ---------------------------------------------------------------------- bulrush · 2016-06-04 18:46 I got it. But I can't remove my own topic here. Here's what worked: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var fn:string;    tfOut: TextFile;fn:='mimetype';AssignFile(tfOut, fn);try  // Create the file, write some text and close it.  rewrite(tfOut);  write(tfOut, 'application/epub+zip');  CloseFile(tfOut);except  // If there was an error the reason can be found here  on E: EInOutError do    writeln('File handling error occurred. Details: ', E.ClassName, '/', E.Message);end; ---------------------------------------------------------------------- marcov · 2016-06-04 18:51 Btw runcommand is not deprecated, no more than e.g. tprocess. Just the versions that take the commandline in one string are. ---------------------------------------------------------------------- RAW · 2016-06-04 19:07 What about using TFileStream... ?