In that situation, you'd need to use:
fs.find( "/*/" .. whatToSearch )
However, fs.find() is really suited for situations where you want multiple returns - say you've got a folder filled with files (eg "save1", "save2", "save3" etc) and you want to get all of them, it's a handy shortcut for doing so.
If you want to search for a file and don't know how many levels deep it's buried in the file system, you really need to do some looping with fs.list(). Eg:
local function searchFor(searchTerm, searchDir)
searchTerm = searchTerm:lower() -- Assuming you want a case-insensitive search
searchDir = searchDir or "" -- If the directory to search wasn't specified, start at the root of the drive.
local dirContents = {fs.list(searchDir)}
dirContents[1].path = searchDir
while #dirContents > 0 do
local thisDir, thisDirIndex = dirContents[#dirContents], #dirContents
for i=1,#thisDir do
local combined = fs.combine(thisDir.path,thisDir[i])
if thisDir[i]:lower() == searchTerm then
return combined
elseif fs.isDir(combined) then
dirContents[#dirContents+1] = fs.list(combined)
dirContents[#dirContents].path = combined
end
end
table.remove(dirContents, thisDirIndex)
end
end
print(searchFor(read()))