1
我試過搜索谷歌,並提出幾乎沒有任何關於通過xcode在Mac上搜索文件和文件夾。搜索文件和文件夾驅動器
這是可能的和如何?任何代碼示例等
我曾經在delphi中編程,搜索路徑的代碼片段就是這樣。
procedure SearchFolders(path:string);
var
sr : tsearchrec;
res: integer;
i:integer;
begin
path:= includetrailingpathdelimiter(path);
res:= findfirst(path+'*.*',faAnyfile,sr);
while res = 0 do begin
application.processmessages;
if (sr.name <> '.') and (sr.name <> '..') then
if DirectoryExists(path + sr.name) then
SearchFolders(path + sr.name)
else
FileProcess.Add(path + sr.name);
FileSize:=FileSize+sr.Size;
res := findnext(sr);
end;
findclose(sr);
end;
要激活,其SearchFolders('C:\');並搜索路徑並將其存儲到字符串列表中。
它是如何在osx內完成xcode的?