Skip to content

Commit

Permalink
Auto-create directories for logs
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Sep 27, 2024
1 parent ad211cd commit 6706bc2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Utils/AOtp.pas
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ OtpLine = class

public constructor(fname: string; timed: boolean := false; req_kinds: OtpKind? := nil; bad_kinds: OtpKind? := nil);
begin
fname := System.IO.Path.GetFullPath(fname);
System.IO.Directory.CreateDirectory(System.IO.Path.GetDirectoryName(fname));
self.bu_fname := fname+'.backup';
self.main_sw := new System.IO.StreamWriter(fname, false, enc);
self.backup_sw := new System.IO.StreamWriter(bu_fname, false, enc);
Expand Down

0 comments on commit 6706bc2

Please sign in to comment.