Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 910683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:04:57+00:00 2026-05-15T17:04:57+00:00

This is a very simple question. I have a script in the same folder

  • 0

This is a very simple question. I have a script in the same folder as the Cocoa app. I can’t seem to set the path to it properly for setLaunchPath for NSTask. Help please.

I have a folder called Project. Inside of it, exist multiple folders but only two we care about: Classes (the source files for the Cocoa app are here) and Ruby (which is a ruby server folder). I am trying to call Ruby/script/server. I assumed it would be something like ./Ruby/script/server or Ruby/script/server but both are wrong.

Thanks.

EDIT: I guess what I’m actually asking is if there is a way to access the folder where the source files or the project is by using a special character or shortcut because by default it goes to the /tmp folder.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T17:04:58+00:00Added an answer on May 15, 2026 at 5:04 pm

    The current directory (in the unix sense) in an app is not guaranteed to be anything. The path to the app itself can be obtained by getting the main app bundle by

    NSBundle*mainBundle=[NSBundle mainBundle];
    

    and then getting its path

    NSString*path=[mainBundle bundlePath];
    

    However please don’t do that; you won’t be able to distribute your app without extra instructions of putting files here and there.
    Instead, put your Ruby code inside yourApp.app/Contents/Resources/. This can be done by including the Ruby code in the XCode, and making sure it’s set to be copied into the app. The files inside this Resources directory can be obtained as follows:

    NSString*path=[mainBundle pathForResource:@"rubyServer" ofType:@"rb"];
    

    To learn more about the bundle structure, read Bundle Programming Guide.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This may seem a very silly question. Consider this: I have a simple Boolean
This is a very simple question, but I can't seem to find something about
I have a very simple question, but can't seem to find a strait answer
Very simple question. If I have this: <link id=lowtech rel=stylesheet type=text/css href=css/lowtech.css /> <script
This is a very simple question yet I have little knowledge in Linux and
i have a very simple question, actually this is not the question, this is
Okay this question is very simple: I have a facebook page, and a website.
I'm sure this is a very simple question, but embarrassed to say I can't
Very simple question this time, basically I have a group of folders and some
Sorry if this question may be simple, but I can't seem to find an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.