URGENT! How to copy with holes?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers URGENT! How to copy with holes?
# 1  
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!
# 2  
Old 09-24-2008
The Linux cp command has an option --sparse=auto which should do what you want.
# 3  
Old 09-24-2008
I have no solution but am very curious what the point of doing this is? What do you mean by holes?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

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. 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

7. 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

8. 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

9. 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
Login or Register to Ask a Question