2
0

File Permissions

This commit is contained in:
glax 2023-06-01 18:28:58 +02:00
parent a57903cd5a
commit 8bb6fb902b
2 changed files with 9 additions and 1 deletions

View File

@ -1,7 +1,9 @@
using System.IO.Compression;
using System.Net;
using System.Runtime.InteropServices;
using System.Xml.Linq;
using Logging;
using static System.IO.UnixFileMode;
namespace Tranga;
@ -171,6 +173,8 @@ public abstract class Connector
logger?.WriteLine("Connector", $"Creating archive {saveArchiveFilePath}");
//ZIP-it and ship-it
ZipFile.CreateFromDirectory(tempFolder, saveArchiveFilePath);
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
File.SetUnixFileMode(saveArchiveFilePath, GroupRead | GroupWrite | OtherRead | OtherWrite | UserRead | UserWrite);
Directory.Delete(tempFolder, true); //Cleanup
}

View File

@ -1,6 +1,8 @@
using System.Text;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using Newtonsoft.Json;
using static System.IO.UnixFileMode;
namespace Tranga;
@ -56,6 +58,8 @@ public readonly struct Publication
string seriesInfoPath = Path.Join(publicationFolder, "series.json");
if(!File.Exists(seriesInfoPath))
File.WriteAllText(seriesInfoPath,this.GetSeriesInfoJson());
if(RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
File.SetUnixFileMode(seriesInfoPath, GroupRead | GroupWrite | OtherRead | OtherWrite | UserRead | UserWrite);
}
/// <returns>Serialized JSON String for series.json</returns>