1 | please include function appendToFile. |
2 | |
3 | static void appendToTextFile_uniq(File f, S s) { |
4 | if (empty(s)) ret; |
5 | lock appendToFile_lock; |
6 | S text = loadTextFile(f); |
7 | if (!contains(lines(text), s)) |
8 | appendToFile(f, (empty(text) || endsWithNewLine(text) ? "" : "\n") + assureTrailingNewLineIfNempty(s)); |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1015296 |
Snippet name: | appendToTextFile_uniq |
Eternal ID of this version: | #1015296/2 |
Text MD5: | eb66b43ed7ce334b5fc58096c0e5ba52 |
Author: | stefan |
Category: | javax / io |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-11 14:20:22 |
Source code size: | 317 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 329 / 389 |
Version history: | 1 change(s) |
Referenced in: | [show references] |