Sponsored Content
Top Forums UNIX for Dummies Questions & Answers URGENT! How to copy with holes? Post 302239841 by kominbhai on Wednesday 24th of September 2008 02:05:15 PM
Old 09-24-2008
URGENT! How to copy with holes?

I need to write a program that reads in data from a file with holes and copy the file.
the cp command copies the file but the holes use disk blocks then;
but when this progrm copies the file the new file should not have hose extra blocks.
the file should be copied with holes.


PLZZ help!
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

URGENT,URGENT- Need help tape drive installation

Hi, I am trying to attach tape drive to sun V890 running Solaris 9 on it. I have installed HBA(qlogic) in slot 1 of 0-8 slots and booted the system. I do not see HBAin prtdiag output. The tape drive is not attached to HBA. The tape drive I am going to attach is Sony AIT3. 1.How can I make... (3 Replies)
Discussion started by: sriny
3 Replies

2. Shell Programming and Scripting

Urgent !!! Shell script to copy files to VSS

Hi all !!! I need this sample script urgently. Please help. Suppose I do an "ls -ltr" in a directory and store the output in a text file (say "a.txt"). What I need to do is to write a shell script which reads file-names from "a.txt" and copies only those files to VSS. Let's say the destination... (1 Reply)
Discussion started by: devalin
1 Replies

3. Shell Programming and Scripting

Copy the first & third columns in to another test file. Its very urgent please

Hello friends! Here is the scenario. I have a flat file named FILE1.TXT with multiple columns and comma as delimiter. Now my task is to create another file called FILE2.TXT which contains the FIRST & THIRD column values from FILE1.TXT separated by comma. Which mean i am creating a new... (5 Replies)
Discussion started by: sai_kris_007
5 Replies

4. Programming

locate holes in a sparse file.

Lets say my program reads one block (4096 bytes) at a time from a file. It needs to report whether that block is a hole. The program currently uses read() to read 1 block into a 4KB buffer. Now I know that even if that block is a hole, it will be replaced by a sequence of NULL bytes '\0'... (15 Replies)
Discussion started by: tantric
15 Replies

5. UNIX for Dummies Questions & Answers

What is in-core copy and disk-copy of i-node table?

I have found a question from the exercises of my study mat. The question is "Why are there a in-core copy and a disk-copy of i-node block and super block?" If any one know the proper answer then please send me..... (1 Reply)
Discussion started by: dearanik
1 Replies

6. Shell Programming and Scripting

To copy a a file to last created directory..Urgent pls

I need to copy a file example hhh.txt to the recently created directory by name flexite@latesttimestamp in the path interface/home/ ... I couldnt get the name of recently created directory .... first result of ls -lst ...that is ls -lst |head -2 gives the latest directory but i could not... (2 Replies)
Discussion started by: helloo
2 Replies

7. UNIX for Dummies Questions & Answers

Copy a file based on the size-Urgent

Hi, I need unix code to check the size of a file. for example if the size of the file in A folder is more than 1BM, then i have to move that particular file in to B folder whenever I run that particular script. regards, Srinivas. (7 Replies)
Discussion started by: vysrinivas
7 Replies

8. Shell Programming and Scripting

how to copy the directory but not copy certain file

Hi experts cp bin root src /mnt but not copy bin/bigfile any help? ( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum) Thanks (6 Replies)
Discussion started by: yanglei_fage
6 Replies

9. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies
xfs_bmap(8)						      System Manager's Manual						       xfs_bmap(8)

NAME
xfs_bmap - print block mapping for an XFS file SYNOPSIS
xfs_bmap [ -adlpv ] [ -n num_extents ] file DESCRIPTION
xfs_bmap prints the map of disk blocks used by files in an XFS filesystem. The map lists each extent used by the file, as well as regions in the file that do not have any corresponding blocks (holes). Each line of the listings takes the following form: extent: [startoffset..endoffset]: startblock..endblock Holes are marked by replacing the startblock..endblock with hole. All the file offsets and disk blocks are in units of 512-byte blocks, no matter what the filesystem's block size is. OPTIONS
-a If this option is specified, information about the file's attribute fork is printed instead of the default data fork. -d If portions of the file have been migrated offline by a DMAPI application, a DMAPI read event will be generated to bring those por- tions back online before the disk block map is printed. However if the -d option is used, no DMAPI read event will be generated for a DMAPI file and offline portions will be reported as holes. -l If this option is used, then <nblocks> blocks will be appended to each line. nblocks is the length of the extent described on the line in units of 512-byte blocks. This flag has no effect if the -v option is used. -n num_extents If this option is given, xfs_bmap obtains the extent list of the file in groups of num_extents extents. In the absence of -n, xfs_bmap queries the system for the number of extents in the file and uses that value to compute the group size. -p If this option is used, xfs_bmap obtains all unwritten (preallocated) extents that do not contain written data. With the -v option, the flags column will show which extents are preallocated/unwritten. -v Shows verbose information. When this flag is specified, additional AG specific information is appended to each line in the following form: agno (startagoffset..endagoffset) nblocks flags A second -v option will print out the flags legend. SEE ALSO
xfs_fsr(8), xfs(5). xfs_bmap(8)
All times are GMT -4. The time now is 10:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy