68 posts
Location
Land of the Pharos
Posted 18 July 2017 - 03:21 AM
So I started working on a dtdmp (data dump) program and I've tried for what seems to be 4 - 5 hours trying to figure it out and yes I did follow the rules of thumb: check the api list, look for similar and resolved issues on the forum, check if anyone has done such a thing!
why I need this is for a turtle to communicate with a computer via a disk drive to instantly give instructions to each other.
I've tried the fs api. the copy program, and I can't come up with a solution to blacklist things to copy to the drive.
With regards
- Qwerty -
7083 posts
Location
Tasmania (AU)
Posted 18 July 2017 - 04:36 AM
local blacklist = {["someFileName"] = true, ["someOtherFileName"] = true, ["yetAnotherFileName"] = true}
if not blacklist[varWithNameOfFileYouWantToCopy] then
-- copy file
end
If you're still having trouble, elaborate on the part where you're getting stuck - what code have you tried, and how did the result differ from what you wanted?
68 posts
Location
Land of the Pharos
Posted 18 July 2017 - 06:30 AM
sorry if I haven't described my exquisite desires to copy every single item on the computer exept disk/ and rom/, in the mean time, thank you for your loyal devotion to this quite intriguing and amazing community!
with regards
- Qwerty -
7083 posts
Location
Tasmania (AU)
Posted 18 July 2017 - 06:39 AM
If you only want to blacklist files that "aren't on the computer's own drive", then you just need to check that fs.getDrive(path) == "hdd".
68 posts
Location
Land of the Pharos
Posted 18 July 2017 - 06:45 AM
but then how do I blacklist the rom folder? thanks tho for the drive check!
7083 posts
Location
Tasmania (AU)
Posted 18 July 2017 - 07:00 AM
"rom" is considered a drive of its own.
68 posts
Location
Land of the Pharos
Posted 18 July 2017 - 07:34 AM
well thank you kind sir!