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 762105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:55:03+00:00 2026-05-14T15:55:03+00:00

Given a filename in C, I want to determine whether this file exists and

  • 0

Given a filename in C, I want to determine whether this file exists and has execute permission on it. All I’ve got currently is:

if( access( filename, X_OK) != 0 ) {

But this wont search the PATH for files and will also match directories (which I don’t want). Could anyone please help?

Edit:

As an alternative, seeing as I’m running execvp() in a child process, is there a way to check the return value of execvp() and signal the parent process to die with an error message?

  • 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-14T15:55:04+00:00Added an answer on May 14, 2026 at 3:55 pm

    Ended up having to set the FD_CLOEXEC flag on a new pipe and writing an error message through it after the exec if it had failed. I could then read the error message from the parent and determine whether exec was successful or not.

    Thanks for your effort though guys, upvoted for the help

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

Sidebar

Related Questions

i have given required permission : <uses-permission android:name=android.permission.WRITE_EXTERNAL_STORAGE /> hard-coded the path as /sdcard/filename
Given a string location and string file name, is it possible to execute a
I have a filename in a string. I want to split the given string
I want to test (true or false) whether an arbitrary XML file matches a
I've got CodeFirst collection defined as defined below. For any given EmailOwnerId, I want
I have posted this problem yesterday..but unfortunately, no one has given me the solution
I want to replace these characters with string.Empty: '<>?*/\| in given Filename How to
I want to search surfs in all images in a given directory and save
Given a path to a file or directory, how can I determine the mount
Given a filename in the form someletters_12345_moreleters.ext , I want to extract the 5

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.