This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
tesla1889's profile picture

Standardization

Started by tesla1889, 24 January 2013 - 06:01 PM
tesla1889 #1
Posted 24 January 2013 - 07:01 PM
we need to start standardizing where our programs save their data and files.
my suggestion is to follow FHS (shown below), but other suggestions would be appreciated


/ -- root directory
/bin -- command binaries (for use in terminals)
/boot -- programs to run at startup, such as bootloaders
/dev -- probably would be used for device drivers instead of devices
/etc -- config files
/home -- user files
/lib -- program libraries
/media -- media drivers
/mnt -- no idea for CC
/opt -- optional packages
/proc -- kernel filesystem
/root -- root filesystem
/sbin -- system binaries
/srv -- no idea for CC
/tmp -- temporary files
/usr -- pseudo-read-only user files
/var -- logs and caches

Cranium #2
Posted 24 January 2013 - 07:03 PM
This may be fine and all for serious programming but…..you know this is for a game right?
theoriginalbit #3
Posted 24 January 2013 - 07:05 PM
I semi do this for my programs anyways… except I use ".support/<prog-name>"
tesla1889 #4
Posted 24 January 2013 - 07:24 PM
This may be fine and all for serious programming but…..you know this is for a game right?
yeah, but this would prevent save directory collisions
D3matt #5
Posted 25 January 2013 - 02:06 AM
This may be fine and all for serious programming but…..you know this is for a game right?
yeah, but this would prevent save directory collisions
How? Just save to <programname>.

Save directory collision is not something I've ever seen anyone have problems with.
Pinkishu #6
Posted 25 January 2013 - 03:23 AM
This may be fine and all for serious programming but…..you know this is for a game right?

Just cause its a game doesn't mean you have to make your programs a pain for users :P/>
Cloudy #7
Posted 25 January 2013 - 03:25 AM
This is pointless to be honest. Standardisation won't help anything.
Tiin57 #8
Posted 25 January 2013 - 09:23 AM
This is pointless to be honest. Standardisation won't help anything.
I agree, there's little to no save directory collisions in the first place.
cant_delete_account #9
Posted 25 January 2013 - 09:29 AM
This is pointless to be honest. Standardisation won't help anything.
I agree, there's little to no save directory collisions in the first place.
Yeah, I use .thesbros/programname, who else would use that path?
BigSHinyToys #10
Posted 25 January 2013 - 12:24 PM
I put the config in the same folder as the program or in the root but it is easily changed in the code if there are major problems.
Spoiler

local config = "mouse.cfg"
local temp
if shell and shell.getRunningProgram then
temp = shell.getRunningProgram()
end
temp = temp or "/bla"
local localPath = string.sub(temp,1,#temp-string.len(fs.getName(temp)))
temp = nil -- just because not needed
-- load config file
if fs.exists(localPath.."/"..config) then
 load()
else
 useDefault()
end
Wired2coffee #11
Posted 25 January 2013 - 02:22 PM
This could be useful to make sure that there is no data loss from switching Operating Systems. You could just switch out your old operating system for a new one and all files would be exactly the same.
D3matt #12
Posted 25 January 2013 - 02:38 PM
This could be useful to make sure that there is no data loss from switching Operating Systems. You could just switch out your old operating system for a new one and all files would be exactly the same.
Except they probably don't use the same format, so even if they're in the same location, they might not be readable.