Skip to content

Revert "Implement FileManager.url{s,}(for:…) and NSSearchPathForDirectoriesInDomains." #1596

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

Merged
merged 1 commit into from
Jun 12, 2018
Merged
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
6 changes: 0 additions & 6 deletions Foundation.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
0383A1751D2E558A0052E5D1 /* TestStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0383A1741D2E558A0052E5D1 /* TestStream.swift */; };
03B6F5841F15F339004F25AF /* TestURLProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03B6F5831F15F339004F25AF /* TestURLProtocol.swift */; };
1513A8432044893F00539722 /* FileManager_XDG.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1513A8422044893F00539722 /* FileManager_XDG.swift */; };
1520469B1D8AEABE00D02E36 /* HTTPServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1520469A1D8AEABE00D02E36 /* HTTPServer.swift */; };
153E951120111DC500F250BE /* CFKnownLocations.h in Headers */ = {isa = PBXBuildFile; fileRef = 153E950F20111DC500F250BE /* CFKnownLocations.h */; settings = {ATTRIBUTES = (Private, ); }; };
153E951220111DC500F250BE /* CFKnownLocations.c in Sources */ = {isa = PBXBuildFile; fileRef = 153E951020111DC500F250BE /* CFKnownLocations.c */; };
Expand Down Expand Up @@ -516,7 +515,6 @@
/* Begin PBXFileReference section */
0383A1741D2E558A0052E5D1 /* TestStream.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestStream.swift; sourceTree = "<group>"; };
03B6F5831F15F339004F25AF /* TestURLProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestURLProtocol.swift; sourceTree = "<group>"; };
1513A8422044893F00539722 /* FileManager_XDG.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileManager_XDG.swift; sourceTree = "<group>"; };
1520469A1D8AEABE00D02E36 /* HTTPServer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HTTPServer.swift; sourceTree = "<group>"; };
153E950F20111DC500F250BE /* CFKnownLocations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CFKnownLocations.h; sourceTree = "<group>"; };
153E951020111DC500F250BE /* CFKnownLocations.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = CFKnownLocations.c; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1824,7 +1822,6 @@
children = (
EADE0B5D1BD15DFF00C49C64 /* FileHandle.swift */,
EADE0B5E1BD15DFF00C49C64 /* FileManager.swift */,
1513A8422044893F00539722 /* FileManager_XDG.swift */,
EADE0B7A1BD15DFF00C49C64 /* Process.swift */,
5BDC3F2F1BCC5DCB00ED97BB /* Bundle.swift */,
5BDC3F411BCC5DCB00ED97BB /* ProcessInfo.swift */,
Expand Down Expand Up @@ -2347,7 +2344,6 @@
5BECBA3A1D1CAE9A00B39B1F /* NSMeasurement.swift in Sources */,
5BF7AEB21BCD51F9008F214A /* NSNumber.swift in Sources */,
61D2F9AF1FECFB3E0033306A /* NativeProtocol.swift in Sources */,
1513A8432044893F00539722 /* FileManager_XDG.swift in Sources */,
B9974B991EDF4A22007F15B8 /* HTTPURLProtocol.swift in Sources */,
5BCD03821D3EE35C00E3FF9B /* TimeZone.swift in Sources */,
EADE0BBC1BD15E0000C49C64 /* URLCache.swift in Sources */,
Expand Down Expand Up @@ -2717,7 +2713,6 @@
DYLIB_COMPATIBILITY_VERSION = 150;
DYLIB_CURRENT_VERSION = 1303;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_TESTABILITY = YES;
FRAMEWORK_VERSION = A;
GCC_PREFIX_HEADER = CoreFoundation/Base.subproj/CoreFoundation_Prefix.h;
HEADER_SEARCH_PATHS = (
Expand Down Expand Up @@ -2791,7 +2786,6 @@
DYLIB_COMPATIBILITY_VERSION = 150;
DYLIB_CURRENT_VERSION = 1303;
DYLIB_INSTALL_NAME_BASE = "@rpath";
ENABLE_TESTABILITY = YES;
FRAMEWORK_VERSION = A;
GCC_PREFIX_HEADER = CoreFoundation/Base.subproj/CoreFoundation_Prefix.h;
HEADER_SEARCH_PATHS = (
Expand Down
325 changes: 4 additions & 321 deletions Foundation/FileManager.swift

Large diffs are not rendered by default.

125 changes: 0 additions & 125 deletions Foundation/FileManager_XDG.swift

This file was deleted.

24 changes: 1 addition & 23 deletions Foundation/NSPathUtilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -562,29 +562,7 @@ extension FileManager {
}

public func NSSearchPathForDirectoriesInDomains(_ directory: FileManager.SearchPathDirectory, _ domainMask: FileManager.SearchPathDomainMask, _ expandTilde: Bool) -> [String] {
let knownDomains: [FileManager.SearchPathDomainMask] = [
.userDomainMask,
.networkDomainMask,
.localDomainMask,
.systemDomainMask,
]

var result: [URL] = []

for domain in knownDomains {
if domainMask.contains(domain) {
result.append(contentsOf: FileManager.default.urls(for: directory, in: domain))
}
}

return result.map { (url) in
var path = url.absoluteURL.path
if expandTilde {
path = NSString(string: path).expandingTildeInPath
}

return path
}
NSUnimplemented()
}

public func NSHomeDirectory() -> String {
Expand Down
Loading