why the inode index of file system starts from 1 unlike array index(0)


 
Thread Tools Search this Thread
Special Forums Hardware Filesystems, Disks and Memory why the inode index of file system starts from 1 unlike array index(0)
# 1  
Old 08-17-2008
why the inode index of file system starts from 1 unlike array index(0)

why do inode indices starts from 1 unlike array indexes which starts from 0

its a question from "the design of unix operating system" of maurice j bach

id be glad if i get to know the answer quickly

Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copy of array by index value fails

Hello, I have a complicated situational find and replace that I wrote in bash because I didn't know how to do everything in awk. The code works but is very slow, as expected. To create my modified file, I am looping through an array that was populated earlier and making some replacements at... (6 Replies)
Discussion started by: LMHmedchem
6 Replies

2. Shell Programming and Scripting

Associative array index question

I am trying to assign indexes to an associative array in a for loop but I have to use an eval command to make it work, this doesn't seem correct I don't have to do this with regular arrays For example, the following assignment fails without the eval command: #! /bin/bash read -d "\0" -a... (19 Replies)
Discussion started by: Riker1204
19 Replies

3. Shell Programming and Scripting

Index problem in associate array in awk

I am trying to reformat the table by filling any missing rows. The final table will have consecutive IDs in the first column. My problem is the index of the associate array in the awk script. infile: S01 36407 53706 88540 S02 69343 87098 87316 S03 50133 59721 107923... (4 Replies)
Discussion started by: yifangt
4 Replies

4. Shell Programming and Scripting

build array name based on loop index

Hi, I am new to perl and I have the following query please help here. I have following array variables declaration @pld1 = qw(00 01 02 03 04 05); @pld2 = qw(10 11 12 13 14 15); for(my $k=1;$k<=2;$k++) { //I want here to use @pld1 if $k is 1 // and @pld2 if $k is 2. How to do... (3 Replies)
Discussion started by: janavan
3 Replies

5. Programming

Merge sort when array starts from zero(0) index???

Hi friends, I have implemented the merge sort algorith in c, before I put forward my question, you please have a look at my code. // The array is sorted, as 1234 #include <stdio.h> #include <stdlib.h> #include <math.h> int A = {4, 3, 2, 1}; void Merge_Sort(int , int, int); void... (0 Replies)
Discussion started by: gabam
0 Replies

6. Shell Programming and Scripting

dynamic index for array in while loop

Hi, I'm just trying to use a dynamic index for some array elements that I'm accessing within a loop. Specifically, I want to access an array at variable position $counter and then also at location $counter + 1 and $counter + 2 (the second and third array positions after it) but I keep getting... (0 Replies)
Discussion started by: weak_code-fu
0 Replies

7. Shell Programming and Scripting

Sort from start index and end index in line

Hi All, I have a file (FileNames.txt) which contains the following data in it. $ cat FileNames.txt MYFILE17XXX208Sep191307.csv MYFILE19XXX208Sep192124.csv MYFILE20XXX208Sep192418.csv MYFILE22XXX208Sep193234.csv MYFILE21XXX208Sep193018.csv MYFILE24XXX208Sep194053.csv... (5 Replies)
Discussion started by: krish_indus
5 Replies

8. Shell Programming and Scripting

awk array index help

$ cat file.txt A|X|20 A|Y|20 A|X|30 A|Z|20 B|X|10 A|Y|40 Summing up $NF based on first 2 fields, $ awk -F "|" 'BEGIN {OFS="|"} { sum += $NF } END { for (f in sum) print f,sum } ' file.txt o/p: A|X|50 A|Y|60 A|Z|20 (4 Replies)
Discussion started by: uwork72
4 Replies

9. UNIX for Advanced & Expert Users

sql variable as array index

hi folks i am facing problom while trying to access sql variable as array index ina unix shell script....script goes as below.. #!/bin/ksh MAX=3 for elem in alpha beeta gaama do arr=$elem ((x=x+1)) Done SQL_SERVER='servername' /apps/sun5/utils/sqsh -S $SQL_SERVER -U user -P pwd -b -h... (1 Reply)
Discussion started by: sudheer157
1 Replies

10. UNIX for Dummies Questions & Answers

wh inode index starts from 1 unlike array index (0)

brothers why inode index starts from 1 unlike array inex which starts from 0 its a question from the design of unix operating system of maurice j.bach i need to know the answer urgently...someone help please (1 Reply)
Discussion started by: sairamdevotee
1 Replies
Login or Register to Ask a Question
xpc_array_create(3)					   BSD Library Functions Manual 				       xpc_array_create(3)

NAME
xpc_array_create -- creation and management of XPC arrays SYNOPSIS
#include <xpc/xpc.h> xpc_object_t xpc_array_create(const xpc_object_t *objects, size_t count); void xpc_array_set_value(xpc_object_t array, size_t index, xpc_object_t value); void xpc_array_append_value(xpc_object_t array, xpc_object_t value); xpc_object_t xpc_array_get_value(xpc_object_t array, size_t index); size_t xpc_array_get_count(xpc_object_t array); bool xpc_array_apply(xpc_object_t array, xpc_array_applier_t applier); void xpc_array_set_bool(xpc_object_t array, size_t index, bool value); void xpc_array_set_int64(xpc_object_t array, size_t index, int64_t value); void xpc_array_set_uint64(xpc_object_t array, size_t index, uint64_t value); void xpc_array_set_double(xpc_object_t array, size_t index, double value); void xpc_array_set_date(xpc_object_t array, size_t index, int64_t value); void xpc_array_set_data(xpc_object_t array, size_t index, const void *bytes, size_t length); void xpc_array_set_string(xpc_object_t array, size_t index, const char *value); void xpc_array_set_uuid(xpc_object_t array, size_t index, const uuid_t value); void xpc_array_set_fd(xpc_object_t array, size_t index, int value); void xpc_array_set_connection(xpc_object_t array, size_t index, xpc_connection_t value); bool xpc_array_get_bool(xpc_object_t array, size_t index); int64_t xpc_array_get_int64(xpc_object_t array, size_t index); uint64_t xpc_array_get_uint64(xpc_object_t array, size_t index); double xpc_array_get_double(xpc_object_t array, size_t index); int64_t xpc_array_get_date(xpc_object_t array, size_t index); const void * xpc_array_get_data(xpc_object_t array, size_t index, size_t *length); const uint8_t * xpc_array_get_uuid(xpc_object_t array, size_t index); const char * xpc_array_get_string(xpc_object_t array, size_t index); int xpc_array_get_fd(xpc_object_t array, size_t index); xpc_connection_t xpc_array_get_connection(xpc_object_t array, size_t index); ARRAYS
XPC arrays are collections of XPC objects ordered by index. The index is zero-based. XPC arrays are contiguous, and values must exist at all indexes between zero and the greatest index of the array. A hole in the array can be simulated by using a null object as returned by xpc_null_create(3). CREATION
The xpc_array_create() function returns a newly created array. The caller may optionally provide objects, a C array of XPC object references, to initialize the array. The count is used to specify the size of the C array. If objects is NULL, then count must be zero. If count speci- fies more elements than are actually present in values or if values is NULL and count is non-zero, the behavior is undefined. GETTING AND SETTING VALUES
The xpc_array_append_value() function may be used to append a value to the end of an array. This operation increases the count of the values in the array by one. The value of a specific index in the array may be set using the xpc_array_set_value() function. The value must be non-NULL, and the index must already exist (i.e. less than the count provided at creation or extended through previous append operations). The value at a specific index of an array may be retrieved using the xpc_array_get_value() function. The result of getting a non-existing index (i.e. one that was not specified at creation or through a previous append operation) in undefined. PRIMITIVE GET AND SET FUNCTIONS
Various functions exist for retrieving primitive C and operating system types directly from an array without the need for an intermediate boxed object. See xpc_object(3) for more information. The special XPC_ARRAY_APPEND constant may be used to append a value to the end of the array instead of operating on a specific index. SEE ALSO
xpc_object(3), xpc_objects(3), xpc_dictionary_create(3) Darwin 1 July, 2011 Darwin