Results 1 to 5 of 5

Thread: Creation of an index for file

  1. #1
    Join Date
    Mar 2009
    Posts
    176

    Creation of an index for file

    I do a program to manage a number of data stored on a file, and that I will carry out operations (search, add ...).

    The problem is that you create an index which will also be stored on a file, and I do not understand how to put it in place.

    For example, if I make a table that includes the types (eg, my file has films -> I want to look for an action movie), I do not understand how to link this table with the other elements of the file ( I have a movie with a name, type etc).

    Otherwise there are the trees but it's the same I do not understand how, if I create a structure with the file and the key to identification of the film, I fail to see how the hierarchical ordered data tree, and then how to connect all the movies with my index.

    I do not know if it is comprehensible what I said, I just want to be informed on the operation and the creation of the index (that is it is a function in their own right?)

  2. #2
    Join Date
    May 2008
    Posts
    271

    Re: Creation of an index for file

    You do not have access to a database?

    That's it for this, and a motion base that is still easier than simply typing the key problems of dead, corrupted files, etc..

    Otherwise, simply working with files using a specific format. Either XML, or stupidly CSV with automatic interpretation house. And store them in hash tables (eg structures linked with an identifier and some fields).

    In all cases, you must think about your data model before you begin typing a single line of code.

  3. #3
    Join Date
    May 2008
    Posts
    685

    Re: Creation of an index for file

    An index file is like an index at the end of a book. It has on each line: the key, then the page number, or registration, or address, where the corresponding record in the key. Usually, it indicates the number of bytes in the data file where the record and can then pick up the registration with fseek () and fread ().

    If you want to do a search on the title of a film, it must be an index whose key is the film titles. If you want to research the kind of film, it must be another index which is the key type of film.

  4. #4
    Join Date
    May 2008
    Posts
    271

    Re: Creation of an index for file

    I had not interpreted "index" in this sense, is that what is required.

    Not that the basic principle is difficult to code, but say that there is a whole list of cases to manage the design database took years to resolve (for example, detect the need to rebuild an index after a crash or any recovery).

    Again, in this case I would prefer to use a database to focus on the data model and leave the technical management to a proven software. Especially there are free with APIs for the attack in C (MySQL).

  5. #5
    Join Date
    Mar 2009
    Posts
    176

    Re: Creation of an index for file

    Ok, so basically if I want to search for several different criteria, I must create as many indexes as there are criteria?

Similar Threads

  1. Replies: 5
    Last Post: 13-06-2012, 02:04 PM
  2. Creation of jar file with MS-DOS
    By Logan 2 in forum Software Development
    Replies: 5
    Last Post: 08-03-2010, 02:36 PM
  3. Inserting an index entry into index 0 of file 25
    By Dharmesh Arora in forum Operating Systems
    Replies: 3
    Last Post: 16-07-2009, 10:10 AM
  4. about creation file error
    By shortie009 in forum Operating Systems
    Replies: 3
    Last Post: 09-12-2008, 11:49 AM
  5. Creation / Opening file:
    By rohit007 in forum Software Development
    Replies: 2
    Last Post: 03-10-2008, 07:50 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,750,572,331.81535 seconds with 16 queries