Sponsored Content
Full Discussion: reading file headers
Top Forums UNIX for Dummies Questions & Answers reading file headers Post 302310999 by jim mcnamara on Monday 27th of April 2009 02:57:59 PM
Old 04-27-2009
To start with - look into
Code:
man dirent

This only gets directory information.

Basically - the data you are talking about is only available in kernel mode. What you want to do is look into the filesystem code for your box - ufs, ffs, ext2, or whatever.

Google for 'McKusick fast file system' to see what I'm talking about - there are some videos.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove Headers throughout a data file

I have a data file with over 500,000 records/lines that has the header throughout the file. SEQ_ID Name Start_Date Ins_date Add1 Add2 1 Harris 04/02/08 03/02/08 333 Main Suite 101 2 Smith 02/03/08 01/23/08 287 Jenkins SEQ_ID Name ... (3 Replies)
Discussion started by: psmall
3 Replies

2. Shell Programming and Scripting

Remove text between headers while leaving headers intact

Hi, I'm trying to strip all lines between two headers in a file: ### BEGIN ### Text to remove, contains all kinds of characters ... Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c om/updates/ Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies

3. Shell Programming and Scripting

Merging of files with different headers to make combined headers file

Hi , I have a typical situation. I have 4 files and with different headers (number of headers is varible ). I need to make such a merged file which will have headers combined from all files (comman coluns should appear once only). For example - File 1 H1|H2|H3|H4 11|12|13|14 21|22|23|23... (1 Reply)
Discussion started by: marut_ashu
1 Replies

4. Shell Programming and Scripting

Multiple headers in a file

Hi , I have a .txt file in which I have multiple headers, the header record starts with $ symbol...like the first column name is $Account. I have to keep the header in the first line and delete all the remaining headers which are in the file. I tried using sort adc.txt | uniq -u , but my... (7 Replies)
Discussion started by: gaur.deepti
7 Replies

5. Shell Programming and Scripting

Replacing headers based on a second file

I have a file with thousands of sequences that looks like this: I need to replace the headers using a second file Thus, I will end up having the following file: I am looking for an AWK script that I can easily plug in my current pipeline. Any help will be greatly appreciated! (6 Replies)
Discussion started by: Xterra
6 Replies

6. Shell Programming and Scripting

Editing File Headers

Hey Guys, Absolute neewbie here. I am trying to see if it is possible to edit headers/meta-data of files in Mac OSX. I am basically trying to change an audio file header to read 16bit instead of 24bit. We have an issue with some of our software and it regularly exports 16bit audio files with... (3 Replies)
Discussion started by: andysuperaudiom
3 Replies

7. Shell Programming and Scripting

Modify record headers from file

Dear All I was wondering if anybody is able to help me with a script I am struggling with. I have to add comments to the "head-lines" (start with >) from an other file according to the ID tag. Only the head lines should be modified. cat File.txt >H1_A1_A2_A3_A4_ID1_A5 A:B:C:S:E:E:K... (4 Replies)
Discussion started by: loba
4 Replies

8. Shell Programming and Scripting

Merging File with headers

Hi I need to merge 4 files. The issue i am facing is all the files have headers and i do not want them in the final output file. Can anybody suggest how to do it? (5 Replies)
Discussion started by: Arun Mishra
5 Replies

9. UNIX for Dummies Questions & Answers

Append file name to fasta file headers in Linux

How do we append the file name to fasta file headers in multiple fasta-files in Linux? (10 Replies)
Discussion started by: Mauve
10 Replies

10. UNIX for Advanced & Expert Users

Cannot find logical file format for BSD file headers.

Hi. Unix rookie here. Been looking for a few days for reference documents on how BSD UNIX lays the logical file format onto a disk. Goal is to view/edit with hex editor for data repair. Lots of docs are available for how to use Unix commands (like xxd), but I want to learn the map of how Unix... (4 Replies)
Discussion started by: Chris_top_he_r
4 Replies
FFS(7)						       BSD Miscellaneous Information Manual						    FFS(7)

NAME
ffs -- Berkeley fast file system SYNOPSIS
In the kernel configuration file: options FFS options QUOTA options SOFTUPDATES options SUIDDIR options UFS_ACL options UFS_DIRHASH options UFS_EXTATTR options UFS_EXTATTR_AUTOSTART In fstab(5): /dev/disk0a /mnt ufs rw 1 1 DESCRIPTION
The Berkeley fast file system provides facilities to store file system data onto a disk device. ffs has been optimized over the years for speed and reliability and is the default FreeBSD file system. Quotas options QUOTA This option allows system administrators to set limits on disk usage on a per-user basis. Quotas can be used only on file systems mounted with the quota option; see quota(1) and edquota(8). Soft Updates options SOFTUPDATES The soft updates feature tracks writes to the disk and enforces metadata update dependencies (e.g., updating free block maps) to ensure that the file system remains consistent. To enable soft updates on an unmounted file system, use the following command: tunefs -n enable fs fs can be either a mount point listed in fstab(5) (e.g., /usr), or a disk device (e.g., /dev/da0a). File Ownership Inheritance options SUIDDIR For use in file sharing environments on networks including Microsoft Windows and Apple Macintosh computers, this option allows files on file systems mounted with the suiddir option to inherit the ownership of its directory, i.e., ``if it's my directory, it must be my file.'' Access Control Lists options UFS_ACL Access control lists allow the association of fine-grained discretionary access control information with files and directories. This option requires the presence of the UFS_EXTATTR option, and it is recommended that UFS_EXTATTR_AUTOSTART is included as well, so that ACLs are enabled atomically upon mounting the file system. In order to enable support for ACLs, two extended attributes must be available in the EXTATTR_NAMESPACE_SYSTEM namespace: posix1e.acl_access, which holds the access ACL, and posix1e.acl_default, which holds the default ACL for directories. If you are using file system extended attributes, the following commands may be used to allocate space for and create the necessary EA backing files for ACLs in the root of each file system. In these examples, the root file system is used; see Extended Attributes for more details. mkdir -p /.attribute/system cd /.attribute/system extattrctl initattr -p / 388 posix1e.acl_access extattrctl initattr -p / 388 posix1e.acl_default On the next mount of the root file system, the attributes will be automatically started (if UFS_EXTATTR_AUTOSTART is included in the kernel configuration), and ACLs will be enabled. Directory Hashing options UFS_DIRHASH Implements a hash-based lookup scheme for directories in order to speed up accesses to very large directories. Extended Attributes options UFS_EXTATTR Extended attributes allow the association of additional arbitrary metadata with files and directories, which can be assigned and retrieved from userland as well as from within the kernel; see extattrctl(8). options UFS_EXTATTR_AUTOSTART If this option is defined, ffs will search for a .attribute subdirectory of the file system root during the mount operation. If found, extended attribute support will be automatically started for that file system. The following sysctl(8) MIBs are defined for use with ffs: vfs.ffs.doasyncfree Asynchronously write out modified i-node and indirect blocks upon reallocating file system blocks to be contiguous. (Default: 1.) vfs.ffs.doreallocblks Enable support for the rearrangement of blocks to be contiguous. (Default: 1.) SEE ALSO
quota(1), acl(3), extattr(3), edquota(8), extattrctl(8), sysctl(8) M. McKusick, W. Joy, S. Leffler, and R. Fabry, "A Fast File System for UNIX", ACM Transactions on Computer Systems, 2, 3, 181-197, August 1984. M. McKusick, "Soft Updates: A Technique for Eliminating Most Synchronous Writes in the Fast Filesystem", Proceedings of the Freenix Track at the 1999 Usenix Annual Technical Conference, 71-84, June 2000. BSD
December 26, 2001 BSD
All times are GMT -4. The time now is 08:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy