Skip to content

Commit

Permalink
Draft API changes and add compatibility information
Browse files Browse the repository at this point in the history
  • Loading branch information
Lejdborg committed Jun 30, 2012
1 parent 1dfce6d commit 7d28805
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,28 @@ Are you using NMSSH for something cool? Let me know.

### Using Channels (not yet implemented)

NSString *response = [session execute:@"echo foo"];
#### Executing shell commands

NSString *response = [[session channel] execute:@"echo foo"];
NSLog(@"Response: %@", response);

### SCP file transfer (not yet implemented)
#### SCP file transfer

The SCP API provides a simple way to upload or download files.

The `to:` parameter is flexible in that if you provide a directory, it will keep the same filename as in the from-parameter. But if you provide a complete file name you may name the transferred file anything you want.

#### Uploading files from your local computer

BOOL success = [session uploadFile:@"~/my-local-file.txt" to:@"/var/www/"];
BOOL success = [[session channel] uploadFile:@"~/my-local-file.txt" to:@"/var/www/"];

#### Downloading files from a server

BOOL success = [session downloadFile:@"/var/www/my-remote-file.txt" to:@"~/"];
BOOL success = [[session channel] downloadFile:@"/var/www/my-remote-file.txt" to:@"~/"];

## Compatibility

NMSSH contains a pre-built libssh2 for Mac OSX. It should work just fine with iOS as well if you compile libssh2 yourself and switch the included `libssh2.dylib`.

## License

Expand Down

0 comments on commit 7d28805

Please sign in to comment.