2 posts
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
1281 posts
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
2 posts
Posted 19 May 2014 - 12:16 AM
im meaning to find a specific program that will vary from computer to computer.
656 posts
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…
197 posts
Location
Czech Republic
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
3057 posts
Location
United States of America
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__verifywhich 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.
1610 posts
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.