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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:11:16+00:00 2026-06-15T14:11:16+00:00

In my pure C++ native process (that I run from the terminal with adb)

  • 0

In my pure C++ native process (that I run from the terminal with adb) I’m trying to read a block directly from the SD Card in Android 2.3 SGS2. My code is running with root permissions so it shouldn’t matter.

I know that the SD Card memory mapped to /sys/block/mmcblk1 so I open it:

int fd = open("/sys/block/mmcblk1", O_RDONLY);

which succeeds. Now, when I’m trying to read from it:

bytes_read = read(fd, buffer, 4096);

I get an error: “Is a directory”

Well, I know that this is a directory but it’s still supposed to work, maybe with some other flags in the open?

How can I do this?

  • 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-15T14:11:18+00:00Added an answer on June 15, 2026 at 2:11 pm

    Haha!
    My mistake was indeed that I tried to read from a directory /sys/block/mmcblk1.
    But I should have try to read from /dev/block/mmcblk1!

    Which works perfectly.

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

Sidebar

Related Questions

I have a native C code to android (I'm not using JNI, it's pure
I am trying to compile and run some code, part that I wrote using
So I'm essentially trying to implement an AIR Native Extension that does the physics
Suppose I have a pure virtual method in the base interface that returns to
Is it possible to convert javascript code to machine code or pure native binary?
I've got an Adobe AIR application written in pure AS3 that has some functionality
/clr:pure switch generates pure MSIL but it is not verifible. Native array and pointer
I recently read the blog posts on Pushing Pixels that describe how to achieve
I know how to create a JS-Native bridge in iOS through pure JS code
I've tweaked the native-activity NDK sample to incorporate the OpenGL code from the hello-gl2

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.