Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finishing up other algorithms #19

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
246 changes: 246 additions & 0 deletions FileFinder/FileFinder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
5D5011331C583C3700681B1E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5D5011321C583C3700681B1E /* main.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
5D50112D1C583C3600681B1E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
5D50112F1C583C3700681B1E /* FileFinder */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = FileFinder; sourceTree = BUILT_PRODUCTS_DIR; };
5D5011321C583C3700681B1E /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
5D50112C1C583C3600681B1E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
5D5011261C583C3600681B1E = {
isa = PBXGroup;
children = (
5D5011311C583C3700681B1E /* FileFinder */,
5D5011301C583C3700681B1E /* Products */,
);
sourceTree = "<group>";
};
5D5011301C583C3700681B1E /* Products */ = {
isa = PBXGroup;
children = (
5D50112F1C583C3700681B1E /* FileFinder */,
);
name = Products;
sourceTree = "<group>";
};
5D5011311C583C3700681B1E /* FileFinder */ = {
isa = PBXGroup;
children = (
5D5011321C583C3700681B1E /* main.swift */,
);
path = FileFinder;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
5D50112E1C583C3600681B1E /* FileFinder */ = {
isa = PBXNativeTarget;
buildConfigurationList = 5D5011361C583C3700681B1E /* Build configuration list for PBXNativeTarget "FileFinder" */;
buildPhases = (
5D50112B1C583C3600681B1E /* Sources */,
5D50112C1C583C3600681B1E /* Frameworks */,
5D50112D1C583C3600681B1E /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = FileFinder;
productName = FileFinder;
productReference = 5D50112F1C583C3700681B1E /* FileFinder */;
productType = "com.apple.product-type.tool";
};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
5D5011271C583C3600681B1E /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0720;
LastUpgradeCheck = 0720;
ORGANIZATIONNAME = "Jackie Meggesto";
TargetAttributes = {
5D50112E1C583C3600681B1E = {
CreatedOnToolsVersion = 7.2;
};
};
};
buildConfigurationList = 5D50112A1C583C3600681B1E /* Build configuration list for PBXProject "FileFinder" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
knownRegions = (
en,
);
mainGroup = 5D5011261C583C3600681B1E;
productRefGroup = 5D5011301C583C3700681B1E /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
5D50112E1C583C3600681B1E /* FileFinder */,
);
};
/* End PBXProject section */

/* Begin PBXSourcesBuildPhase section */
5D50112B1C583C3600681B1E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
5D5011331C583C3700681B1E /* main.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
5D5011341C583C3700681B1E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
5D5011351C583C3700681B1E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "-";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
};
name = Release;
};
5D5011371C583C3700681B1E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
5D5011381C583C3700681B1E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
5D50112A1C583C3600681B1E /* Build configuration list for PBXProject "FileFinder" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5D5011341C583C3700681B1E /* Debug */,
5D5011351C583C3700681B1E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
5D5011361C583C3700681B1E /* Build configuration list for PBXNativeTarget "FileFinder" */ = {
isa = XCConfigurationList;
buildConfigurations = (
5D5011371C583C3700681B1E /* Debug */,
5D5011381C583C3700681B1E /* Release */,
);
defaultConfigurationIsVisible = 0;
};
/* End XCConfigurationList section */
};
rootObject = 5D5011271C583C3600681B1E /* Project object */;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions FileFinder/FileFinder/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// main.swift
// FileFinder
//
// Created by Jackie Meggesto on 1/26/16.
// Copyright © 2016 Jackie Meggesto. All rights reserved.
//

import Foundation

import Foundation

func findFile(name: String, atPath: String) -> String {
let fileManager = NSFileManager.defaultManager()
let contents =
try! fileManager.contentsOfDirectoryAtPath(atPath)
for fileOrDir in contents {
var isDir = ObjCBool(false);
let fullPath = atPath + "/" + fileOrDir
let exists = fileManager.fileExistsAtPath(fullPath, isDirectory: &isDir)
if exists && Bool(isDir) {
// YOUR CODE HERE
print("DIR: " + fileOrDir)
} else if exists {
// YOUR CODE HERE
print("FILE: " + fileOrDir)
} else {
print("NEITHER: " + fileOrDir)
}
}
return "NOT FOUND"
}

// print(findFile("APITest.py", atPath: "/Users/jackiemeggesto/Documents"))

print(UINT64_MAX)


Loading