Commit 26286b9
committed
compute store flow path based on user_data folder
There are some enviroments whe erlang-red is running as a non-privileged
user. Thus, if erlang-red is installed on /usr/ path it will not have
the correct permissions when writing flows to disk.
This change allows erlang-red compute a store flow path based on:
1. if flow_store application property has been configured, erlang-red
will use that value. Otherwise:
2. get `user_data` [1] from filename:basedir/2 as a base folder for
storing flows. e.g.: in my host (linux based) the store folder is
/home/joaohf/.local/share/erlang-red/
1: https://www.erlang.org/doc/apps/stdlib/filename.html#basedir/31 parent 2c4e0d3 commit 26286b9
4 files changed
Lines changed: 34 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 72 | + | |
76 | 73 | | |
77 | 74 | | |
78 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
| 138 | + | |
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
| |||
144 | 145 | | |
145 | 146 | | |
146 | 147 | | |
147 | | - | |
| 148 | + | |
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
| 125 | + | |
129 | 126 | | |
130 | 127 | | |
131 | 128 | | |
| |||
146 | 143 | | |
147 | 144 | | |
148 | 145 | | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 146 | + | |
153 | 147 | | |
154 | 148 | | |
155 | 149 | | |
| |||
170 | 164 | | |
171 | 165 | | |
172 | 166 | | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 167 | + | |
177 | 168 | | |
178 | 169 | | |
179 | 170 | | |
| |||
237 | 228 | | |
238 | 229 | | |
239 | 230 | | |
240 | | - | |
| 231 | + | |
| 232 | + | |
241 | 233 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 234 | + | |
246 | 235 | | |
247 | 236 | | |
248 | 237 | | |
| |||
251 | 240 | | |
252 | 241 | | |
253 | 242 | | |
254 | | - | |
255 | | - | |
256 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
257 | 248 | | |
258 | 249 | | |
259 | 250 | | |
| |||
0 commit comments