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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 530k
  • Answers 530k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Sorry to ressurect the thread, but there was no accepted… May 16, 2026 at 11:32 pm
  • Editorial Team
    Editorial Team added an answer You have to use SendInput instead. keybd_event does not support… May 16, 2026 at 11:32 pm
  • Editorial Team
    Editorial Team added an answer You can use: $('#check').attr('checked'); It will show true or false.… May 16, 2026 at 11:32 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a very simple .htaccess file set up to redirect a 404 to
This should be a very simple thing to have run, but for some reason
I have a simple question related to one-line programming. First an example: function test(a)
I have a very simple table with only one column (+ the key column).
I have made a very simple AppleScript to close tabs in Safari. The problem
I have a very simple task called update_feeds: desc Update feeds task :update_feeds do
I'm trying to build a very simple VPS control panel; i have the following
For one of my first ventures into JQuery, I have the very simple goal
What I need to do is have a C# 2005 GUI app call a
I have the following script, where the first and third document.writeline are static and

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.