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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:11:15+00:00 2026-05-11T22:11:15+00:00

Does the FILE type used through standard C functions fopen , etc. have an

  • 0

Does the FILE type used through standard C functions fopen, etc. have an object-oriented interface?

I’m looking for opinions with reasoning rather than an absolute answer, as definitions of OO vary by who you ask. What are the important OO concepts it meets or doesn’t meet?

In response to JustJeff’s comment below, I am not asking whether C is an OO language, nor whether C (easily or not) allows OO programming. (Isn’t that a separate issue?)

  • 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-11T22:11:15+00:00Added an answer on May 11, 2026 at 10:11 pm

    Academically speaking, certainly the actual files are objects. They have attributes and you can perform actions on them. Doesn’t mean FILE is a class, just saying, there are degrees of OO-ness to think about.

    The trouble with trying to say that the stdio FILE interface qualifies as OO, however, is that the stdio FILE interface doesn’t represent the ‘objectness’ of the file very well. You could use FILEs under plain old C in an OO way, but of course you forfeit the syntactic clarity afforded by Java or C++.

    It should probably further be added that while you can’t generate ‘inheritance’ from FILE, this further disqualifies it as OO, but you could argue that’s more a fault of its environment (plain C) than the abstract idea of the file-as-object itself.

    In fact .. you could probably make a case for FILE being something like a java interface. In the linux world, you can operate almost any kind of I/O device through the open/close/read/write/ioctl calls; the FILE functions are just covers on top of those; therefore in FILE you have something like an abstract class that defines the basic operations (open/read/etc) on an ‘abstact i/o device’, leaving it up to the various sorts of derived types to flesh those out with type-specific behavior.

    Granted, it’s very hard to see the OO in a pile of C code, and very easy to break the abstractions, which is why the actual OO languages are so much more popular these days.

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

Sidebar

Related Questions

How does sharepoint identify a file type? For example, SharePoint will not allow you
I have some code that effectively does this : File file = new File(C:\\Program
In MATLAB, why does the file have to be saved prior to running ?
i have a j2me application , it does the File IO operation, but every
I am looping through a big data file and like to detect the type
Does File.deleteOnExit() guarantee that the file is deleted even if the JVM is killed
Does file_get_contents maintain line breaks? I thought it did but I have tried this:
This is inspired by Does File.Copy() from a network share to another share on
In java, does file.delete() return true or false where File file refers to a
The following .htaccess file does not work: SSLrequireSSL RewriteEngine on RewriteCond %{HTTP_HOST} !^secure\.neuralfutures\.com [NC]

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.