The reason it does not work on directories is because a very vital part of a directory entry is the first two bytes which is the inode number of an entry.
The first two entries of a directory are named . and ..
So, if either inode numbers are different csum and/or cksum will report generally report different values.
read: octalDump -decimalCharacter /some/directory
This will output two lines for each entry in the directory /some/directory
The first line: first number is the inode number; second line (ignore first two values (are inode number in character notation) - remaining bytes are the file/directory name) Example:
Hope this helps/explains WHY cksum/csum does not work on directories.
hello all.
I'm not asking about the algorithm - or how it goes about computing the checksum - I'm asking how it views/looks at the files it does the cksum on.
For instance:
Say you had a directory named "dir_A"
And within this directory you had some files.
So:
dir_A
- file1
-... (5 Replies)
Hi there,
I have a query about cksum. I'm running a script on the Unix box and in a script the cksum result differs from when I run it manually. As far as I can see the file is not being changed, is there any other times that the cksum would be different. (4 Replies)
Hi,
I have a working script, well it works on my machine but when I try it on others the cksum section does not work properly (I know the scripting is not of a high quality but I'm just trying to get it working)
Heres the script:
#!/bin/sh
case $# in
0) echo "usage: enshar filename... (7 Replies)
hi,
I am trying to use the cksum feature in unix. when i make a call to it i get returned something along the lines of:
4603435 14 file3
how do i get the first part of this response only; i.e:
4603435
I'm trying to use at a way without the use of sed and creating temp... (4 Replies)
Hi,
On what factors does the cksum depend.
If i build 2 machines exactly the same, then can i get the checksum of 2 compiled files same.
Thanks (3 Replies)
Hi all,
So I have a binary file and I need to generate an expected EEPROM checksum for it. Ideally, I would like to input the file (with the path) and output a computed checksum. Ive been using (cksum file1) with no avail and I was just curious as to whether there is such thing as EEPROM cksum,... (1 Reply)
I did this:
ls -lrRt | grep ^* | cksum *
but it is showing cksum of sub-directories.
Thanks You
Please use code tags when posting data and code samples, thank you. (3 Replies)
Hi,
I am getting read error when i run cksum </dir> but this command runs successfully for the files and in different server it runs for both files and directories. I am using in both the servers solaris 10 with patch 148888-03. Please suggest...
# cksum ravi(directory)
3454912345 0... (3 Replies)
Discussion started by: Navkreddy
3 Replies
LEARN ABOUT PHP
dir_ufs
dir_ufs(4) File Formats dir_ufs(4)NAME
dir_ufs, dir - format of ufs directories
SYNOPSIS
#include <sys/param.h>
#include <sys/types.h>
#include <sys/fs/ufs_fsdir.h>
DESCRIPTION
A directory consists of some number of blocks of DIRBLKSIZ bytes, where DIRBLKSIZ is chosen such that it can be transferred to disk in a
single atomic operation, for example, 512 bytes on most machines.
Each DIRBLKSIZ-byte block contains some number of directory entry structures, which are of variable length. Each directory entry has a
struct direct at the front of it, containing its inode number, the length of the entry, and the length of the name contained in the entry.
These entries are followed by the name padded to a 4 byte boundary with null bytes. All names are guaranteed null-terminated. The maximum
length of a name in a directory is MAXNAMLEN.
#define DIRBLKSIZ DEV_BSIZE
#define MAXNAMLEN 256
struct direct {
ulong_t d_ino; /* inode number of entry */
ushort_t d_reclen; /* length of this record */
ushort_t d_namlen; /* length of string in d_name */
char d_name[MAXNAMLEN + 1]; /* maximum name length */
};
ATTRIBUTES
See attributes(5) for a description of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Unstable |
+-----------------------------+-----------------------------+
SEE ALSO attributes(5), ufs(7FS)SunOS 5.10 16 Apr 2003 dir_ufs(4)