R/W on files in a directory by i-number

This is a discussion on R/W on files in a directory by i-number within the Linux Programming forums, part of the Platform Specific Boards category; I am working with some Unix system calls, and I want to be able to open a directory, and perform ...

  1. #1
    Prying open my third eye.
    Join Date
    Jun 2005
    Posts
    45

    R/W on files in a directory by i-number

    I am working with some Unix system calls, and I want to be able to open a directory, and perform read/write operations on the files in that directory.

    I already know that I can open a directory, then call readdir() to put the i-number and name in a struct.

    So....the question is, can I perform read/write on files with just the i-number?

    Not looking for exact code, just pointers (hah) in the rightr direction.

    EDIT: so really what I need to do is get a file descriptor from a i-number.
    Last edited by Lateralus; 07-26-2005 at 10:42 AM.
    "So you're one of those condescending UNIX computer users?"

    "Here's a nickel, kid. Get yourself a better computer."

  2. #2
    .
    Join Date
    Nov 2003
    Posts
    307
    I must be missing something - struct dirent already has a file name.

    AFAIK -- All of the file open routines use only file names - open, fopen.

    If you need to use only the i-node number, then you'll have to get your kernel's source for the file system and see how file descriptors are created.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Listing specific files in a directory
    By knirirr in forum C Programming
    Replies: 14
    Last Post: 01-29-2008, 05:42 AM
  2. Finding files in a directory
    By smarta_982002 in forum C Programming
    Replies: 1
    Last Post: 01-25-2008, 10:10 AM
  3. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 02:30 PM
  4. I Need To Know Some Things That I Can Put Into A Batch File
    By TheRealNapster in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 10-20-2003, 09:12 PM
  5. Loading all files in a directory
    By steve_i83 in forum Windows Programming
    Replies: 2
    Last Post: 08-26-2001, 03:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21