Sponsored Content
Top Forums Programming Very simple Unix Prog in C, could use advice/help Post 17241 by AtleRamsli on Tuesday 12th of March 2002 02:06:05 PM
Old 03-12-2002
Sorry, it was with reference to the original post, where the semantics was
open! Did it work? No?
Then create ... and continue ...

That, of course, lead to a bug.

(1)
So, I tried to illustrate a point that was no directly related to just opening and creating files, but to calling functions that might return errors in general.

(2)
Sometimes, the course of action may be different when the file is already there.

(3)
Also, I have gotten the habit of doing it that way from some old, long forgotten systems.

Atle
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Advice on UNIX/Linux

I have 6 extra hard drives and want to install them in my boxes and run UNIX, LINUX andyes M$ Winblows. How do I make it so i have the choice of which HD to boot from? Also, which UNIX distribution should i run to get aquainted with it, and wheres the best place to get it? Thank you very much if... (5 Replies)
Discussion started by: r1sk
5 Replies

2. UNIX Desktop Questions & Answers

Learning Unix , Advice?

I am a long-time Windows NT, 2000 user at home and work. I want to learn Unix to broaden myself. What flavor do you recommend and how do you recommend practicing with it at home? how to get a copy of it to practice with? (1 Reply)
Discussion started by: robmaxfli
1 Replies

3. UNIX for Dummies Questions & Answers

Advice to build a cheap Unix machine?

Hello! In my perpetual quest to learn Unix, I want to build a cheap Unix server for my personal use. Do you guys have suggestions of web sites, vendors etc...where I could get info on things such as step-by-step instruction, 2nd hand hardware etc... I would like to go preferably with a HP... (2 Replies)
Discussion started by: alan
2 Replies

4. UNIX for Dummies Questions & Answers

Re-learning Unix - need some advice.

I learned Unix about 6 years ago, I think it was the System V version back then. My course taught me, Unix commands, shell scripting, Vi editor, and probably more stuff. I wanted to stick with Unix but life didn't allow me to, my college back then used Windows 95 and then my job as a... (8 Replies)
Discussion started by: thoughts
8 Replies

5. UNIX for Dummies Questions & Answers

UNIX Help & Advice

I originally sent this as a PM to Neo, but I was ignorant towards the rule of PMing someone with technical information. Below is a copy / paste of the questions I asked. If anyone can help, I'd appreciate it tons. Thank you! :D The first OS I ever encountered was DOS and Windows 3.1. Ever since... (1 Reply)
Discussion started by: ZeeSquared
1 Replies

6. UNIX for Dummies Questions & Answers

UNIX advice needed desperately :/

Firstly I do need to state that I am turning here as a last resort. Im in my first year of a Computer Networking and technical support course, and as a first year I must complete a Introductory Unix/Linux class. I have been doing well in the course so far however I have been stumped on the final... (1 Reply)
Discussion started by: setaylor5
1 Replies

7. Solaris

Advice to become a unix guru?

Hello, I have recently completed my training for Solaris 10 and have a good understanding of the bases now. I am playing around with my system but can't do much since my knowledge is limited. I am looking for some projects or some threads where I can learn more and expand my knowledge step by... (16 Replies)
Discussion started by: saudsos
16 Replies

8. UNIX for Dummies Questions & Answers

Advice needed regarding Unix doc/book

I am a newbie Oracle DBA. All our oracle servers are hosted in AIX and Solaris Environment. I have no knowledge about this Unix O/S. So, it will be great if anyone here can suggest me any good book which will teach me the basics. Any inputs/suggestions will be great for me. (1 Reply)
Discussion started by: sandip250382
1 Replies

9. Shell Programming and Scripting

Need advice for project UNIX to Linux migration

I am working on UNIX AIX to Linux migration. Does anybody know the good site for doing this? Thanks for contribution (4 Replies)
Discussion started by: digioleg54
4 Replies
dbm(3C) 																   dbm(3C)

NAME
dbminit, fetch, store, delete, firstkey, nextkey, dbmclose - database subroutines SYNOPSIS
DESCRIPTION
These functions maintain key/content pairs in a database. They handle very large (a billion blocks (block = 1024 bytes)) databases and can locate a keyed item in one or two file system accesses. key and content parameters are described by the type. A specifies a string of dsize bytes pointed to by dptr. Arbitrary binary data, as well as normal ASCII strings, are allowed. The database is stored in two files. One file is a directory containing a bit map of keys and has as its suffix. The second file contains all data and has as its suffix. Before a database can be accessed, it must be opened by At the time of this call, the files and must exist. (An empty database is created by creating zero-length and files.) Once open, data stored under a key is accessed by and data is placed under a key by Storing data on an existing key replaces the existing data. A key (and its associated contents) is deleted by A linear pass through all keys in a database can be made, in (apparently) random order by using and returns the first key in the database. With any key, returns the next key in the database. The following code can be used to traverse the database: A database can be closed by calling A currently open database must be closed before opening a new one. DIAGNOSTICS
All functions that return an indicate errors with negative values and success with zero. Functions that return a indicate errors with a null dptr. WARNINGS
The dbm functions provided in this library should not be confused in any way with those of a general-purpose database management system such as ALLBASE/HP-UX SQL. These functions provide for multiple search keys per entry, they protect against multi-user access (in other words they do not lock records or files), and they provide the many other useful data base functions that are found in more robust database management systems. Creating and updating databases by use of these functions is relatively slow because of data copies that occur upon hash collisions. These functions for applications requiring fast lookup of relatively static information that is to be indexed by a single key. The file will contain holes so that its apparent size is about four times its actual content. Some older UNIX systems create real file blocks for these holes when touched. These files cannot be copied by normal means (such as cp(1), cat(1), tar(1), or ar(1)) without expan- sion. dptr pointers returned by these subroutines point into static storage that is changed by subsequent calls. The sum of the sizes of a key/content pair must not exceed the internal block size (currently 1024 bytes). Moreover, all key/content pairs that hash together must fit on a single block. returns an error if a disk block fills with inseparable data. does not physically reclaim file space, although it does make it available for reuse. The order of keys presented by and depends on a hashing function, not on anything interesting. A or during a pass through the keys by and may yield unexpected results. AUTHOR
dbm(3C) was developed by the University of California, Berkeley. SEE ALSO
ndbm(3X). dbm(3C)
All times are GMT -4. The time now is 09:03 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy