• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: capture console output
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: capture console output


  • Subject: Re: capture console output
  • From: Billy Flatman <email@hidden>
  • Date: Thu, 22 Apr 2010 11:23:40 +0100

Hi Dave,

Thanks for that, just what I was looking for.

Cheers,

Billy.
On 22 Apr 2010, at 11:04, Dave Keck wrote:

>> FILE *file = popen("sqlite3 test.db .tables","r");
>>
>> However, I've not been able to read the information from the returned file.
>
> What exactly isn't working? Maybe this helps:
>
>    NSString *fullPathToDatabase = @"/Users/dave/test.db";
>    NSTask *sqliteTask = [[NSTask alloc] init];
>    NSPipe *readPipe = [NSPipe pipe];
>
>    [sqliteTask setLaunchPath: @"/usr/bin/sqlite3"];
>    [sqliteTask setArguments: [NSArray arrayWithObjects:
>        fullPathToDatabase, @".tables", nil]];
>    [sqliteTask setStandardOutput: readPipe];
>    [sqliteTask launch];
>
>    NSLog(@"sqlite wisdom: %@", [[[NSString alloc] initWithData:
>        [[readPipe fileHandleForReading] readDataToEndOfFile]
>            encoding: NSUTF8StringEncoding] autorelease]);

Billy Flatman
email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >capture console output (From: Billy Flatman <email@hidden>)
 >Re: capture console output (From: Dave Keck <email@hidden>)

  • Prev by Date: Re: capture console output
  • Next by Date: Re: Determining preferred localizations
  • Previous by thread: Re: capture console output
  • Next by thread: App is in Landscape Mode, but main UIWindow still thinks it’s portrait.
  • Index(es):
    • Date
    • Thread