In a function:
//ref: Ice.Contracts.Lib.ServerPath
//using System.IO;
CallService<Ice.Contracts.ServerPathSvcContract>(serverPathSvc =>
{
List<Ice.Lib.ServerPath.Types.PathInfo> pathInfo = new List<Ice.Lib.ServerPath.Types.PathInfo>();
pathInfo = serverPathSvc.GetPaths(Epicor.ServiceModel.Utilities.SpecialFolder.CompanyData, "", false);
if(pathInfo.Count > 0)
{
string path = $"{pathInfo.First().FullName}\\testing.txt";
File.WriteAllText(path, "In this file I put some text. You will have to do what's next.");
}
});