diff options
| -rw-r--r-- | ShiftOS.Objects/ShiftFS.cs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ShiftOS.Objects/ShiftFS.cs b/ShiftOS.Objects/ShiftFS.cs index fa7a9e6..e14c2a8 100644 --- a/ShiftOS.Objects/ShiftFS.cs +++ b/ShiftOS.Objects/ShiftFS.cs @@ -43,6 +43,7 @@ namespace ShiftOS.Objects.ShiftFS { public string Name; public byte[] Data; + public byte[] HeaderData; public bool ReadAccessToLowUsers; public Permissions permissions; public System.IO.Stream GetStream() @@ -346,6 +347,27 @@ namespace ShiftOS.Objects.ShiftFS } + public static byte[] GetHeaderData(string filePath) + { + return GetFileInfo(filePath).HeaderData; + } + + public static string GetHeaderText(string filePath) + { + byte[] header = GetHeaderData(filePath); + return (header == null) ? "" : Encoding.UTF8.GetString(header); + } + + public static void SetHeaderData(string filePath, byte[] data) + { + GetFileInfo(filePath).HeaderData = data; + } + + public static void SetHeaderText(string filePath, string text) + { + SetHeaderData(filePath, Encoding.UTF8.GetBytes(text)); + } + public static string[] GetDirectories(string path) { string[] pathlist = path.Split('/'); |
