Hi everybody!.
I'm having some trouble with files...the problem is... i don't know how to edit a file once it's written. ?(
for example, i have a file that contains this:
Entry{
User = "CPRS"
SlotCount = 3
HubsCount = 1
GiB = 37.61028316058218
}
Entry{
User = "TEST"
SlotCount = 3
HubsCount = 1
GiB = 37.61028316058218
}
Entry{
User = "Problem"
SlotCount = 3
HubsCount = 1
GiB = 37.61028316058218
}
What I want to do, is to search for a user "TEST", if exist to delete that entry.
I've read the manual but still can't figure out how to do it.
So I need an example...:D
Thanks guys! :))
if that is the file you wanne write you better think it over.
here's a real lua table.
tUserInfo = {
["CPRS"] = {
iSlotCount = 3,
iHubsCount = 1,
iGiB = 37.61028316058218,
},
["TEST"] = {
iSlotCount = 3,
iHubsCount = 1,
iGiB = 37.61028316058218,
},
["Problem"] = {
iSlotCount = 3,
iHubsCount = 1,
iGiB = 37.61028316058218,
}
}
which you can proces really easy.
if tUserInfo["TEST"] then -- check if it excists
tUserInfo["TEST"] = nil -- and delete
end
and opening the file.
dofile(filename)
plop
Thanks! I will try that and see.. :D :D