简体   繁体   English

如何在fireMonkey Rad studio XE2中为Mac Osx创建/编辑文本文件(.rtf)?

[英]How to Create/Edit a text file (.rtf) for Mac Osx in fireMonkey Rad studio XE2?

我已经在Rad Studio xe2中创建了Fire Monkey HD应用程序,已经使用AssignFile()在应用程序中为Windows创建了文本文件,现在我想为MAC OSx创建文本文件,该怎么办?

Delphi includes the System.IOUtils.TFile this is a record containing methods used to perform various operations on files, So to create a text file you can use the TFile.WriteAllText passing the content of the file directly or use the TFile.Create method that create a file and return a TFileStream . Delphi包含System.IOUtils.TFile这是一条记录,其中包含用于对文件执行各种操作的方法,因此,要创建文本文件,可以使用TFile.WriteAllText直接传递文件的内容,也可以使用TFile.Create方法创建一个文件并返回TFileStream Also you can use the TFileStream class directly. 您也可以直接使用TFileStream类。

All the above methods works in Windows and OSX. 以上所有方法均适用于Windows和OSX。

AssignFile is a seriously outdated function. AssignFile是一个严重过时的功能。

In modern (and cross platform) apps you should be using streams. 在现代(和跨平台)应用程序中,您应该使用流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM