in reply to Re: How to read contents of a file without opening it and print the contents
in thread How to read contents of a file without opening it and print the contents

Based on that analogy, couldn't you have your script open and read /dev/hda1, parse the filesystem, find the file and read its data?

  • Comment on Re^2: How to read contents of a file without opening it and print the contents

Replies are listed 'Best First'.
Re^3: How to read contents of a file without opening it and print the contents
by zek152 (Pilgrim) on Jun 10, 2011 at 13:50 UTC

    That's why I put the word open in quotes.

    In your example I would say that "opening" /dev/hda1 means that you are "opening" a set of which the file is a subset. "Opening" a set implies that you have "opened" all subsets. (note the continued use of quotation marks)

    Because I know that someone will point out that opening a set does not imply opening all subsets (example: a box filled with other boxes) I will clarify that in this case I am refering to sets that contain only singletons (in this case bytes or blocks) as elements.

    Update: fixed moderate typo.

      I'm going to have settle for merely hiding the open in a system call:
      `cat filename > /dev/lp0`