Skip to content
Snippets Groups Projects
Commit ee3920f6 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

New load lib to calculate disk usage in a specified directory (w/pattern)

Use like this:
var diskusage = load({}, "diskusage.js");
print(diskusage.get("/*.txt"));
parent 47f8c020
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1195 failed
// Calculate disk usage in specified directory/pattern
"use strict";
function get(dir)
{
var used = 0;
var list = directory(dir);
for(var i = 0; i < list.length; i++) {
if(!file_isdir(list[i]))
used += file_size(list[i]);
}
return used;
}
this;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment