Sponsored Content
Top Forums Programming Question about several things in C Post 302135966 by V4D3R on Thursday 13th of September 2007 10:51:35 PM
Old 09-13-2007
Question about several things in C

Hey guys, first of all I'd like to say Hi to everyone. I am new here and this is my first post.

I have a question about some C stuff. I am in Computer Science and I have an assignment for a UNIX Applications course. It is really complicated, however.

We're using the C language for this and this is my first time using it(I have used C++ before and theres not really any major differences, as far as I know).

Our prof has asked us to examine disk files in hex. He wants us to write a program that will be used as a command with several options. First, I remember we could easily use getopts to handle options in Bash. Is there a similar command for C?

Then he wants us to display the relative offset from the start of a file. Is there a command for that too? I can't find anything in my textbooks and any help would be appreciated.
 

4 More Discussions You Might Find Interesting

1. Programming

Complicating things?

So basically what im trying to do is ... Open file, read that file, than try to find .. We or we and replace them with I, but not replace the cases where words contain We or we, such as Went, went, etc a and replace them with the, but not replace the cases where words contain a, such as... (1 Reply)
Discussion started by: bconnor
1 Replies

2. UNIX for Dummies Questions & Answers

Just trying to find out a few things ....

Hi everyone Just a couple of quick questions if I may. Can I ask what is meant by "flavours"?? I've come across it many times in the forums and I'm guessing that it is a variery of either Linux or UNIX (I know nil about either) which has developed but not really got a clue. ... (1 Reply)
Discussion started by: Tiramisu
1 Replies

3. Shell Programming and Scripting

moving cursor up and other things

Hi guys, this is how my script looks like so far: height=$(($(tput lines) -2)) echo 'Owner Group Other Filename' echo '----- ----- ----- --------' echo cd $directory path=$(pwd) levels=0 level=$(($(echo $path | tr '/' ' ' | wc -w) +1)) for dir in / $(echo $path |... (2 Replies)
Discussion started by: darkhider
2 Replies

4. UNIX for Dummies Questions & Answers

things root can't do

Hey all my co-workers and I are trying to put together a list of things root "Can't" do on any *NIX OS, so I wanted to come here and see what all we could come up with. Here are two to start this off: write to a read only mount FS kill a tape rewind Please add what you know. Thanks,... (5 Replies)
Discussion started by: sunadmn
5 Replies
cckddiag(1)						      General Commands Manual						       cckddiag(1)

NAME
cckddiag - Hercules CCKD DASD diagnostic tool SYNOPSIS
cckddiag [options...] filename DESCRIPTION
Hercules support tool used to assist in the diagnosis of CCKD DASD problems. Operates on Hercules CCKD DASD volumes in read-only mode, and displays various information contained in CCKD DASD files. Effective usage requires internal knowledge of Hercules CCKD DASD files. OPTIONS
The following options are used to specify which portions of the CCKD DASD file are to be displayed. Options may not be combined; for exam- ple, -cd1 is not a valid option. Surround each option by blank(s). Argument numbers may be specified either in decimal or hexadecimal. If the number begins with the characters 0x the number is presumed to be hexadecimal; else the number is presumed to be decimal. No numeric overflow checking is done, the user is assumed (!) to know what they're doing. Options are divided into three categories: global options, track-related options, and the offset option. Global options filename specifies the Hercules CCKD DASD filename (sometimes referred to as the DASD image file) -v display version and exit -d display DEVHDR -c display CDEVHDR -1 display L1TAB (note this option is a numeric one) -g enable debug output Track-related options To direct cckddiag to a specific track, two options are provided: -a and -r. The remaining track-related options describe the kind of out- put desired. The TRKHDR for the track is displayed for all track-related options. -a cc hh display absolute CCHH data - where cc and hh are respectively the cylinder number (relative zero), and the head number (relative zero). -r tt display relative track data - where tt is the track number (relative zero). -2 display L2TAB - requires a corresponding -a or -r specification to direct cckddiag to a specific track. -t display track data - displays the COUNT, KEY, and DATA record summaries for the data residing on the indicated track. -x hex display track key/data - displays the KEY and DATA records' contents in hexadecimal display format for the indicated track. Some repetitive data may be omitted from the hex display output. Offset option This option provides the ability to examine any portion of the CCKD file, as an alternative to track specification. -o oo ll hex display data at offset oo of length ll. SEE ALSO
cckd(4) http://www.hercules-390.org/ the Hercules emulator homepage. http://www.hercules-390.org/cckddasd.html which describes the Hercules CCKD DASD facility. HISTORY
2003-02-07 originally written by James M. Morrison 2003-02-03 cckddiag(1)
All times are GMT -4. The time now is 02:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy