Skip to content
Jimmy Cushnie edited this page Feb 22, 2019 · 3 revisions

SUCC.Utilities is a static class containing various utilities.

DefaultPath

When you create a new DataFile, you pass it the path of the file on disk. If you pass it an absolute (rooted) path, it will just use that path. Otherwise, the path will be relative to Utilities.DefaultPath.

You can set a custom DefaultPath if you like. See Version Differences for the default location of DefaultPath in different versions of SUCC.

SuccFileExists

Test to see if a SUCC file exists on disk at a given path. You can pass this function a relative or absolute path, same as when creating a DataFile.

LineEndingStyle

In computer science, lots of things are standardized between different platforms. Unfortunately, line endings are not (yet) one of them. Utilities.LineEndingStyle lets you control how SUCC saves newlines when writing files.

  • LineEndingStyle.Unix: \n
  • LineEndingStyle.Windows: \r\n
  • LineEndingStyle.PlatformDefault (default): Windows style when on Windows, Unix style everywhere else.

AbsolutePath

Pass Utilities.AbsolutePath the path of a file or directory. If the path is already absolute, it will be returned as-is. Otherwise, the function will return an absolute path with your supplied path relative to Utilities.DefaultPath.

This is the same function DataFiles use to determine what their location on disk should be.

FileExtension

All configuration files managed by SUCC have the file extension Utilities.FileExtension. This field is read-only and will always return .succ.