paritial file copy 
Author Message
 paritial file copy

i want to create a smaller file from a larger file.
In other words, I like to extract a smaller portion of a media file from the
original one.

Is there a way?
I try to copy the file to another path and then cancelling it before its
complete, however, the partial copy file did not appear.



Fri, 19 Nov 2004 07:49:31 GMT  
 paritial file copy
There is no API that will copy only part of a file (and as you found out,
canceling a copy will rewind the whole thing).
You need to open the file, read what you need to read and then write it out
to the target file.

--
. . . . . . . . . . . . . . . . . . . . . .
Klaus H. Probst, MVP
   http://www.vbbox.com/

Please post/reply to the newsgroup(s)


Quote:
> i want to create a smaller file from a larger file.
> In other words, I like to extract a smaller portion of a media file from
the
> original one.

> Is there a way?
> I try to copy the file to another path and then cancelling it before its
> complete, however, the partial copy file did not appear.



Fri, 19 Nov 2004 08:22:28 GMT  
 paritial file copy
Is there a sample code that can help me out?
Is there buffer involve with loops?



Quote:
> There is no API that will copy only part of a file (and as you found out,
> canceling a copy will rewind the whole thing).
> You need to open the file, read what you need to read and then write it
out
> to the target file.

> --
> . . . . . . . . . . . . . . . . . . . . . .
> Klaus H. Probst, MVP
>    http://www.vbbox.com/

> Please post/reply to the newsgroup(s)



> > i want to create a smaller file from a larger file.
> > In other words, I like to extract a smaller portion of a media file from
> the
> > original one.

> > Is there a way?
> > I try to copy the file to another path and then cancelling it before its
> > complete, however, the partial copy file did not appear.



Fri, 19 Nov 2004 11:47:20 GMT  
 paritial file copy
ummm.....

dim intFF as integer 'for freefile
dim mystring as string
mystring = string(2000)'the number is where you should put how much of the
file you want(bytes)
intFF = FreeFile

open "File.exe" for binary as intFF
get #intFF, , mystring
close intFF
intFF = FreeFile
open "OutputFile.exe" for binary as intFF
put #intFF, ,mystring
close intFF

this works for me.....just replace file.exe with the file you want to get
part of and outputfile.exe with the file you want to put the new stuff in
in this example 2000 is how many bytes you want to get from the file

hope this helps,
Russell Kinasz  =)



Fri, 19 Nov 2004 12:16:17 GMT  
 paritial file copy
open original as binary type file, then take only waht you need from it to
another binary type output file.

--
best regards,
hapticz



Fri, 19 Nov 2004 20:24:31 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. paritial file copy

2. Find a copy a file with File.Copy method

3. how to use Volume Shadow Copy to copy an in use file

4. Copy a file in a folder and past the copy in another folder

5. Copy a bunch of files but can't cancel in the middle of copy

6. copy folder and copy files

7. DOS Batch File to Copy Files from an Access Application

8. Adding Existing Files to Projects Causes a File Copy Over

9. Copying/Moving files with File class

10. FILE COPYING ACROSS NOVELL FILE SERVERS

11. Copy DBF/DBT files to MDB files

12. How the delete the file cache while copying a file several times

 

 
Powered by phpBB® Forum Software