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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:46:56+00:00 2026-06-15T07:46:56+00:00

On a mac running 10.8 i am trying to open a serial port. ls

  • 0

On a mac running 10.8 i am trying to open a serial port.

ls /dev/cu* returns:

/dev/cu.Bluetooth-Modem     /dev/cu.Bluetooth-PDA-Sync  /dev/cu.usbserial-A1009TT7

i can see the port is there but when i try to open it i get Undefined error: 0(0). This is my code i use to open the port.

char *path = "/dev/cu.usbserial-A1009TT7";

open(path , O_RDWR | O_NOCTTY | O_NONBLOCK);     // open the port

if (file == -1) {
    printf("Error opening port : %s(%d).\n", strerror(errno), errno);
    close(file);
    return -1;
}

anyone have any idea why the port wont open?

thanks in advance.

  • 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-15T07:46:57+00:00Added an answer on June 15, 2026 at 7:46 am

    Whoops! You meant to type this:

    file = open(path , O_RDWR | O_NOCTTY | O_NONBLOCK);
    ^^^^^^^
    

    Also, there is no need to close a file descriptor that isn’t open.

    if (file == -1) {
        printf(...);
        // close(file); Completely unnecessary.  It's not valid!
        return -1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to setup my dev environment on my Mac (running Mac OS
I am trying to upload a 12MB .wav file on a Mac running Transmit
I was trying to get the latest ruby on rails for my Mac running
I'm trying to build zimbra from source on a mac mini running on mac
I'm trying to get rails running on my mac which is running lion. I'm
Trying to install Scrapy on Mac OSX 10.6 using this guide : When running
I'm running git 1.7 on Mac OSX, installed via Homebrew. I'm trying to use
I am trying to get MonoDevelop 2.4 to run on a PowerPC Mac running
Im running Mac OS X Snow Leopard 10.6. When trying to get into phpMyAdmin,
I am running Mac OS X 10.5.8 and am trying to run Netbeans 7.1.2.

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.