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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:51:26+00:00 2026-06-07T22:51:26+00:00

QNX (Neutrino 6.5.0) uses an open source implementation of ksh as its shell. A

  • 0

QNX (Neutrino 6.5.0) uses an open source implementation of ksh as its shell. A lot of the provided scripts, including the system startup scripts, use constructs such as

if ! test /dev/slog -ef /dev/slog; then
    # do something
fi

to check whether a resource manager exists or not in the filesystem. I’ve searched and could only find very dray explanations that -ef checks to see whether the two parameters are in fact the same file. Since the filename specified is the same it seems to just reduce to checking that the file exists.

I have checked the behaviour of test -a and test -e (both seem to check for file existance of any type of file according to the various docs I’ve read) and they seem to also work.

Is there any difference in the checks performed between -ef and -a/-e? Is using -ef some kind of attempt to protect against a race condition in the existence of the file?

  • 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-06-07T22:51:29+00:00Added an answer on June 7, 2026 at 10:51 pm

    Reviewing the strace on Ubuntu Linux’s copy of ksh reveals no substantial differences. One call to stat vs two.

    $ strace test /tmp/tmp.geLaoPkXXC -ef /tmp/tmp.geLaoPkXXC
    

    showed this:

    mmap(NULL, 7220736, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f11dc80b000
    close(3)                                = 0
    stat("/tmp/tmp.geLaoPkXXC", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
    stat("/tmp/tmp.geLaoPkXXC", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
    close(1)                                = 0
    close(2)                                = 0
    

    …whereas

    $  strace test -a /tmp/tmp.geLaoPkXXC
    

    showed this:

    fstat(3, {st_mode=S_IFREG|0644, st_size=7220736, ...}) = 0
    mmap(NULL, 7220736, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f6b49e2b000
    close(3)                                = 0
    stat("/tmp/tmp.geLaoPkXXC", {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
    close(1)                                = 0
    close(2)                                = 0
    

    One stat vs two.

    $ ksh --version
      version         sh (AT&T Research) 93u 2011-02-08
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with an embedded system running QNX that has a stripped-down shell (KSH).
I would like to connect to QNX Neutrino OS (qconn) running on the VirtualBox
I'm coding a UDP datagram receiver in C++ on the QNX operating system and
I'm connecting to QNX Neutrino over SSH with PuTTY 0.62. I've enabled Allow terminal
I've just inherited (ahem) a QNX realtime project which uses a void*/downcasting/case statement mechanism
Is there a way to get Postgresql installed on QNX neutrino? When I try
I'm working on a qnx device, and I want to be able to ssh
I am planning to implement a small-scale data acquisition system on an RTOS platform.
I'm working on an old school linux variant (QNX to be exact) and need
Can someone recommend a UML modelling toolfor QNX? I'm not bothered about generating code

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.