Skip to content

Commit

Permalink
docs: Fix some mistakes in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
amosavian committed Dec 23, 2023
1 parent f3d365e commit 77156f4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 15 deletions.
14 changes: 4 additions & 10 deletions AMSMB2/AMSMB2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,8 @@ public class SMB2Manager: NSObject, NSSecureCoding, Codable, NSCopying, CustomRe
- Parameters:
- atPath: path of directory to be enumerated.
- completionHandler: closure will be run after enumerating is completed.
- recursive: subdirectories will enumerated if `true`.
- completionHandler: closure will be run after enumerating is completed.
- result: An array of `[URLResourceKey: Any]` which holds files' attributes. file name is stored in `.nameKey`.
*/
open func contentsOfDirectory(
Expand All @@ -418,7 +418,6 @@ public class SMB2Manager: NSObject, NSSecureCoding, Codable, NSCopying, CustomRe
- Parameters:
- atPath: path of directory to be enumerated.
- completionHandler: closure will be run after enumerating is completed.
- recursive: subdirectories will enumerated if `true`.
- Returns: An array of `[URLResourceKey: Any]` which holds files' attributes. file name is stored in `.nameKey`.
*/
Expand Down Expand Up @@ -467,7 +466,6 @@ public class SMB2Manager: NSObject, NSSecureCoding, Codable, NSCopying, CustomRe
- Parameters:
- forPath: Any pathname within the mounted file system.
- completionHandler: closure will be run after fetching attributes is completed.
- Returns: A dictionary object that describes the attributes of the mounted file system on which path resides.
See _File-System Attribute Keys_ for a description of the keys available in the dictionary.
*/
Expand Down Expand Up @@ -512,7 +510,6 @@ public class SMB2Manager: NSObject, NSSecureCoding, Codable, NSCopying, CustomRe
- Parameters:
- atPath: path of file to be enumerated.
- completionHandler: closure will be run after enumerating is completed.
- Returns: An dictionary with `URLResourceKey` as key which holds file's attributes.
*/
open func attributesOfItem(atPath path: String) async throws -> [URLResourceKey: Any] {
Expand Down Expand Up @@ -625,13 +622,11 @@ public class SMB2Manager: NSObject, NSSecureCoding, Codable, NSCopying, CustomRe
}

/**
Returns the path of the item pointed to by a symbolic link.
Creates a new symbolic link pointed to given destination.
- Parameters:
- atPath: The path of a file or directory.
- completionHandler: closure will be run after reading link is completed.
- Returns: An String object containing the path of the directory or file to which the symbolic link path refers.
If the symbolic link is specified as a relative path, that relative path is returned.
- path: The path of a file or directory.
- destination: Item that symbolic link will point to.
*/
func createSymbolicLink(atPath path: String, withDestinationPath destination: String) async throws {
try await withCheckedThrowingContinuation { continuation in
Expand Down Expand Up @@ -662,7 +657,6 @@ public class SMB2Manager: NSObject, NSSecureCoding, Codable, NSCopying, CustomRe
- Parameters:
- atPath: The path of a file or directory.
- completionHandler: closure will be run after reading link is completed.
- Returns: An String object containing the path of the directory or file to which the symbolic link path refers.
If the symbolic link is specified as a relative path, that relative path is returned.
*/
Expand Down
5 changes: 3 additions & 2 deletions AMSMB2/Context.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,11 @@ extension SMB2Context {
try inputBuffer.withUnsafeMutableBytes { buf in
var req = smb2_set_info_request(
info_type: UInt8(SMB2_0_INFO_FILE),
file_info_class: 0x0D,
file_info_class: 0x0d,
input_data: buf.baseAddress,
additional_information: 0,
file_id: file.fileId.uuid)
file_id: file.fileId.uuid
)

try async_await_pdu(dataHandler: EmptyReply.init) {
context, cbPtr -> UnsafeMutablePointer<smb2_pdu>? in
Expand Down
2 changes: 1 addition & 1 deletion AMSMB2/FileHandle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ final class SMB2FileHandle {
if (flags & O_CREAT) != 0 {
if (flags & O_EXCL) != 0 {
createDisposition = SMB2_FILE_CREATE
} else if(flags & O_TRUNC) != 0 {
} else if (flags & O_TRUNC) != 0 {
createDisposition = SMB2_FILE_OVERWRITE_IF
} else {
createDisposition = SMB2_FILE_OPEN_IF
Expand Down
4 changes: 2 additions & 2 deletions AMSMB2/Fsctl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ extension IOCtl {
let reparseTag: UInt32
let buffer: Data

var regions: [Data] {
return [
var regions: [Data] {
[
.init(value: reparseTag),
.init(value: UInt16(buffer.count)),
.init(value: 0 as UInt16), // reserved
Expand Down

0 comments on commit 77156f4

Please sign in to comment.