Comments (7)
Support for Swift 3 has been added in PathKit 0.7.0.
from pathkit.
FYI, I just provided a PR for this. If you want to use it now, you can use my repo ( ratranqu/PathKit). It works with the latest swift 3.0 dev snapshot from 2013/03/24.
from pathkit.
@ratranqu thanks! I tried you branch, but it doesn't compile on Linux:
warning: no sources in test module: /home/saulius/temp/PathKit
Compiling Swift Module 'PathKit' (1 sources)
/home/saulius/temp/PathKit/Sources/PathKit.swift:68:21: error: value of type 'Index' (aka 'String.CharacterView.Index') has no member 'distanceTo'
let index = p.startIndex.distanceTo(p.startIndex.successor())
~~^~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:161:17: error: value of type 'NSString' has no member 'standardizingPath'
return Path(NSString(string: self.path).standardizingPath)
^~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:191:39: error: value of type 'NSFileManager' has no member 'destinationOfSymbolicLink'
let symlinkDestination = try Path.fileManager.destinationOfSymbolicLink(atPath:path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:224:12: error: value of type 'NSString' has no member 'deletingPathExtension'
return NSString(string: lastComponent).deletingPathExtension
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:264:17: error: value of type 'NSFileManager' has no member 'fileExists'
return Path.fileManager.fileExists(atPath:self.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:281:16: error: value of type 'NSFileManager' has no member 'fileExists'
guard Path.fileManager.fileExists(atPath: normalize().path, isDirectory: &directory) else {
~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:302:16: error: value of type 'NSFileManager' has no member 'fileExists'
guard Path.fileManager.fileExists(atPath: normalize().path, isDirectory: &directory) else {
~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:319:24: error: value of type 'NSFileManager' has no member 'destinationOfSymbolicLink'
let _ = try Path.fileManager.destinationOfSymbolicLink(atPath: path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:337:17: error: value of type 'NSFileManager' has no member 'isReadableFile'
return Path.fileManager.isReadableFile(atPath: self.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:351:17: error: value of type 'NSFileManager' has no member 'isWritableFile'
return Path.fileManager.isWritableFile(atPath: self.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:365:17: error: value of type 'NSFileManager' has no member 'isExecutableFile'
return Path.fileManager.isExecutableFile(atPath: self.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:379:17: error: value of type 'NSFileManager' has no member 'isDeletableFile'
return Path.fileManager.isDeletableFile(atPath: self.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:398:14: error: value of type 'NSFileManager' has no member 'createDirectory'
try Path.fileManager.createDirectory(atPath: self.path, withIntermediateDirectories: false, attributes: nil)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:411:14: error: value of type 'NSFileManager' has no member 'createDirectory'
try Path.fileManager.createDirectory(atPath: self.path, withIntermediateDirectories: true, attributes: nil)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:424:14: error: value of type 'NSFileManager' has no member 'removeItem'
try Path.fileManager.removeItem(atPath: self.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:437:14: error: value of type 'NSFileManager' has no member 'moveItem'
try Path.fileManager.moveItem(atPath: self.path, toPath: destination.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:450:14: error: value of type 'NSFileManager' has no member 'copyItem'
try Path.fileManager.copyItem(atPath: self.path, toPath: destination.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:462:14: error: value of type 'NSFileManager' has no member 'linkItem'
try Path.fileManager.linkItem(atPath: self.path, toPath: destination.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:474:14: error: value of type 'NSFileManager' has no member 'createSymbolicLink'
try Path.fileManager.createSymbolicLink(atPath: self.path, withDestinationPath: destination.path)
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:554:47: error: value of type 'NSUUID' has no member 'uuidString'
let path = try processUniqueTemporary() + NSUUID().uuidString
^~~~~~~~ ~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:584:16: error: value of type 'NSString' has no member 'substring'
return try NSString(contentsOfFile: path, encoding: encoding).substring(from:0) as String
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:599:9: error: value of type 'NSData' has no member 'write'
try data.write(toFile:normalize().path, options: .dataWritingAtomic)
^~~~ ~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:619:9: error: value of type 'NSString' has no member 'write'
try NSString(string: string).write(toFile:normalize().path, atomically: true, encoding: encoding)
^~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:646:21: error: value of type 'NSFileManager' has no member 'contentsOfDirectory'
return try Path.fileManager.contentsOfDirectory(atPath:path).map {
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:664:21: error: value of type 'NSFileManager' has no member 'subpathsOfDirectory'
return try Path.fileManager.subpathsOfDirectory(atPath:path).map {
~~~~~^~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
/home/saulius/temp/PathKit/Sources/PathKit.swift:735:39: error: value of type 'NSFileManager' has no member 'enumerator'
self.directoryEnumerator = Path.fileManager.enumerator(atPath:path.path)!
~~~~~^~~~~~~~~~~ ~~~~~~~~~~
<unknown>:0: error: build had 1 command failures
error: exit(1): /home/saulius/.swiftenv/versions/DEVELOPMENT-SNAPSHOT-2016-03-24-a/usr/bin/swift-build-tool -f /home/saulius/temp/PathKit/.build/debug.yaml default
from pathkit.
@saulius: Hum... I didn't touch the Linux bits as no running Linux vms with latest Dev branch. Let me have a look when I hv some time. Can you share which version of swift you are running please?
Thx.
from pathkit.
@ratranqu I use latest DEVELOPMENT-SNAPSHOT-2016-03-24-a
from pathkit.
@sauliusgrigaitis, I've just done a commit on my local copy (and pushed to PR). Can you confirm you are sorted now?
from pathkit.
@ratranqu thanks, looks like it works at least on Linux!
from pathkit.
Related Issues (20)
- PathKit wont compile with swift 3.0 snapshot DEVELOPMENT-SNAPSHOT-2016-05-03-a HOT 1
- Swift Package Manager requires Package.swift HOT 2
- Support for Carthage dropped? HOT 6
- Bump the version to 0.7.1 HOT 4
- I want to get the size of the folder, I found this method < Path.filesize >, but I find that the size of the inaccurate, where is the problem HOT 1
- Going from absolute path to relative? HOT 5
- Combining two pathes including step back lead to incorrect path
- New Tag for SPM 4.0 HOT 5
- Glob function issue HOT 4
- Status of Linux support HOT 10
- Future of Project HOT 3
- Support recursive glob '**' HOT 1
- Why use NSString? HOT 3
- Unable to build with Xcode 13 GM HOT 10
- Xcode 13 compiler error HOT 4
- Glob function on windows HOT 2
- PathKit method calls HOT 1
- It has problem when used in App(not SPM or Terminal)
- How to add text to the last line of a text file
- glob method not matching nested subdirectories HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pathkit.