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

About copying.

Started by leftcatcher, 06 November 2012 - 02:44 PM
leftcatcher #1
Posted 06 November 2012 - 03:44 PM
I just have a quick question, is it possible to make programs unable to be copied? If so, how? I have programs seated in other directories, which doesn't really stop it if someone goes into the directory where they are stored, as they could copy them from there. Just wondering if it's possible to stop that at all.

Thanks in advance!
Lyqyd #2
Posted 06 November 2012 - 04:29 PM
No.
KaoS #3
Posted 07 November 2012 - 02:18 AM
you could try making an open file handle and leaving it open to prevent modification. it might just prevent them from editing it though

EDIT: nevermind. doesn't work at all. I got it working by accident once. can't remember how though
Sammich Lord #4
Posted 08 November 2012 - 03:33 AM
The only way to do what you want is to over-write FS and IO APIs.
kazagistar #5
Posted 08 November 2012 - 03:53 AM
If you don't need the programs on your computer at startup, you can always put them on a disk and run them from there. Just keep the disk on your person?
KaoS #6
Posted 08 November 2012 - 07:35 AM
I just run all of my secret programs remotely. they get sent directly to the PC where they are run
Kingdaro #7
Posted 08 November 2012 - 08:27 AM

local copy = fs.copy

function fs.copy(source, target)
  if source == 'uncopyable' then
    print "You can't copy that!"
  else
    copy(source, target)
  end
end
I just pooped this out in CC a second ago, and it works, as long as the program is ran first.