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

finding a different program

Started by songsteel, 18 May 2014 - 06:56 AM
songsteel #1
Posted 18 May 2014 - 08:56 AM
sorry if this is in the wrong section, but how do i search for a separate program from another, similar to the shell.getRunningProgram() but for a non running program, i'm trying to access the name of a file to use as a variable for my startup program.
thanks
-songsteel
CometWolf #2
Posted 18 May 2014 - 12:02 PM
use fs.list(path) to get a table of the files in a given directory. You can then iterate this table to look for your file. Alternatively, if you're on 1.6 you can just use fs.find
http://computercraft.info/wiki/Fs.find
songsteel #3
Posted 19 May 2014 - 12:16 AM
im meaning to find a specific program that will vary from computer to computer.
flaghacker #4
Posted 19 May 2014 - 06:22 AM
Can you tell us the rules for witch file needs to be found? Because "i want to find a file" is a little vague…
viluon #5
Posted 19 May 2014 - 07:09 AM
Like FlagHacker said, what are you looking for exactly? Do you want to find the file by name? Size? Location? Please be specific
KingofGamesYami #6
Posted 19 May 2014 - 01:38 PM
You could look through this thread:
http://www.computercraft.info/forums2/index.php?/topic/18453-verifying-that-two-files-are-the-same/page__hl__verify
which will most likely make no sense whatsoever. But, they did come up with a way to verify that a file is the same as another file hosted on the web (in github specifically). There is probably an easier way, but it would be less accurate.
apemanzilla #7
Posted 19 May 2014 - 03:16 PM
The only real way you could find different files with the same content across different computers would be to search based on the content of the program, although that may not always be consistent.