Skip to content

Commit 4025be7

Browse files
committed
DOSTextFormat->False
1 parent 5f5c65c commit 4025be7

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

Kernel/FileFormat.wl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ BeginPackage["CoffeeLiqueur`Notebook`FileFormat`"];
33
readNotebook;
44
writeNotebook;
55

6-
endOfLine = If[$OperatingSystem === "Windows", "\r", EndOfLine];
6+
endOfLine = EndOfLine;
77

88
Begin["`Private`"];
99

Kernel/Loader.wl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ BeginPackage["CoffeeLiqueur`Notebook`Loader`", {
7777
If[OptionValue["Temporal"],
7878
Module[{r, stream},
7979

80-
stream = OpenWrite[makeHashPath[dir], BinaryFormat->True];
80+
stream = OpenWrite[makeHashPath[dir], DOSTextFormat->False];
8181
nb`SerializeToStream[stream, notebook];
8282
r = Close[stream];
8383

@@ -93,7 +93,7 @@ BeginPackage["CoffeeLiqueur`Notebook`Loader`", {
9393
With[{h = checkbackups[notebook]}, If[h =!= False, moveBackupSomewhere[h] ] ];
9494

9595
Module[{r, stream},
96-
stream = OpenWrite[dir, BinaryFormat->True];
96+
stream = OpenWrite[dir, DOSTextFormat->False];
9797
nb`SerializeToStream[stream, notebook];
9898
r = Close[stream];
9999
notebook["FileHash"] = FileHash[dir];

Kernel/Notebook.wl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ LoadCellFromFile[path_, notebook_] := Module[{stream, result, legacyQ},
6262

6363
Echo["Loading cells from file"];
6464

65-
stream = OpenRead[path, BinaryFormat->True];
65+
stream = OpenRead[path, DOSTextFormat->False];
6666
result = readNotebook[stream, 10];
6767
Close[stream];
6868

@@ -73,7 +73,7 @@ LoadCellFromFile[path_, notebook_] := Module[{stream, result, legacyQ},
7373
,
7474
Echo["Loading failed. Retrying with a legacy .wln parser..."];
7575

76-
stream = OpenRead[path, BinaryFormat->True];
76+
stream = OpenRead[path, DOSTextFormat->False];
7777
legacyQ = StringMatchQ[ReadLine[stream, TimeConstraint->10], ___~~"<|"~~__];
7878
Close[stream];
7979

@@ -98,7 +98,7 @@ LoadFromFile[path_String | File[path_], opts: OptionsPattern[] ] := Module[{stre
9898

9999
Echo["Loading from file"];
100100

101-
stream = OpenRead[path, BinaryFormat->True];
101+
stream = OpenRead[path, DOSTextFormat->False];
102102
notebook = DeserializeFromStream[stream, opts];
103103
Close[stream];
104104

@@ -108,7 +108,7 @@ LoadFromFile[path_String | File[path_], opts: OptionsPattern[] ] := Module[{stre
108108
,
109109
Echo["Loading failed. Retrying with a legacy .wln parser..."];
110110

111-
stream = OpenRead[path, BinaryFormat->True];
111+
stream = OpenRead[path, DOSTextFormat->False];
112112
legacyQ = StringMatchQ[ReadLine[stream, TimeConstraint->10], ___~~"<|"~~__];
113113
Close[stream];
114114

@@ -153,7 +153,7 @@ LoadFromString[string_String, opts: OptionsPattern[] ] := Module[{stream, notebo
153153

154154
(* legacy format. Keep it for backward compatibillity! *)
155155
(* it does not take that much space! *)
156-
With[{n = Deserialize[ ImportString[string, "WL"], NotebookObj[opts] ]},
156+
With[{n = Deserialize[ ImportString[string, "WL", DOSTextFormat->False], NotebookObj[opts] ]},
157157
If[!MatchQ[n, _NotebookObj], Return[$Failed]; ];
158158
notebook = n;
159159
];

modules/wljs-editor/src/RemoteCells.wl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ exportNotebook[notebook_, savingPath_, ext: ("md" | "mdx" | "html" | "nb")] := W
5757
|>];
5858
]
5959

60-
exportNotebook[notebook_, savingPath_, "wln"] := With[{stream = OpenWrite[savingPath, BinaryFormat->True]},
60+
exportNotebook[notebook_, savingPath_, "wln"] := With[{stream = OpenWrite[savingPath, DOSTextFormat->False]},
6161
notebook["Path"] = savingPath;
6262
notebook["Directory"] = DirectoryName[savingPath];
6363

modules/wljs-editor/src/RemoteCellsKernel.wl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ WLN`WLNImport[filename_String, options___] :=
8282
Module[{assoc, opts = Association[List[options] ], hash = CreateUUID[], fileHash = FileHash[filename]},
8383
If[KeyExistsQ[cache, fileHash], Return[cache[fileHash] ] ];
8484

85-
assoc = Import[filename, "Text"];
85+
assoc = Import[filename, "Text", DOSTextFormat->False];
8686
If[FailureQ[assoc], Return[$Failed] ];
8787

8888
EventFire[Internal`Kernel`CommunicationChannel, "ImportNotebook", <|"Data"->assoc, "Hash"->hash, "FullPath"->FileNameJoin[{DirectoryName[filename], FileNameTake[filename]}], "Path"->DirectoryName[filename], "Kernel"->Internal`Kernel`Hash|>];

0 commit comments

Comments
 (0)