Skip to content

Commit

Permalink
Messages of love to all the fucks that waste my time :)
Browse files Browse the repository at this point in the history
Google should just implement an incremental fucking download manager for their fucking users who don't want to download 50 gb's of data everytime they want a full backup.
  • Loading branch information
makingglitches committed Jun 10, 2022
1 parent c18f49e commit 6226bf5
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 14 deletions.
Binary file added Instructions to setup application.odt
Binary file not shown.
90 changes: 76 additions & 14 deletions mountinfoparser.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,85 @@
const fs = require('fs')
const fs = require('fs');

var f = fs.readFileSync('/proc/self/mounts').toString()

var p = f.split("\n");
class MountInfo
{
constructor(entry)
{
this.Device = entry[0];
this.MountPoint = entry[1];
this.FSType = entry[2];
this.Options = entry[3];
this.DumpOption = entry[4];
this.MountOrder= entry[5];

// so what if there is a goddamn space in the mountpoint name ?
var mounts = [];
this.ContainsPath = function(pathitem)
{
// ok john you're half asleep
// but this should be simple no matter how goddamn old you are
// and you are.
// damn it.

for (var i in p)
{
var toentry = []
// ugh i did this already !

var entry = p[i].split(" ")
// /mounty1/dir
// /mounty1/dir/mounty2
// /mounty1/dir/mounty2/dir2/mounty3
// sort these out if you end up with a file /mounty1/dir/mounty2/dir/mounty3/afile
// obcviously its under the third one.

for (var r in entry)
{
toentry.push(entry[r].replace("\\040"," "))
}
if (fs.existsSync(pathitem))
{
if (pathitem.startsWith(this.MountPoint))
{
return true;
}
}
else
{
return false;
}
}

this.OnDevice = function(item)
{

}
}
}

function FSMounts() {
var f = fs.readFileSync('/proc/self/mounts').toString();

mounts.push(toentry);
var p = f.split('\n');

// so what if there is a goddamn space in the mountpoint name ?
var mounts = [];

for (var i in p) {
var toentry = [];

var entry = p[i].split(' ');

for (var r in entry) {
toentry.push(entry[r].replaceAll('\\040', ' '));
}

var mp = new MountInfo(toentry)
mounts.push(mp);

for (var m in mounts)
{
if (mounts[m] != mp )
{
mp.ContainsPath(mounts[m].MountPoint);
}
}
}

return mounts;
}

module.exports = {
GetMounts: FSMounts,
MountInfo: MountInfo
}

0 comments on commit 6226bf5

Please sign in to comment.