As far as I know there is no way of copying NTFS
compressed files from one NTFS volume to another NTFS
volume without decompressing them.
However, this would be useful in some cases (reducing
copy operation time, saving bandwith etc.), so do any
of you know if this is somehow possible?
Regards,
Razvan
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
> However, this would be useful in some cases (reducing
copy operation time, saving bandwith etc.), so do any
of you know if this is somehow possible?
Create the target file as compressed.
L.
— Ladislav Zezula wrote:
>
> Create the target file as compressed.
>
Can you elaborate on that? How would that eliminate
the need of decompressing the read buffer from the
source fiile in order to write and compress it to the
target file?
Regards,
Razvan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
IIRC there was some FSCTL which allowed you to read compressed data from
the NTFS file.
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
----- Original Message -----
From: “Razvan Hobeanu”
To: “Windows File Systems Devs Interest List”
Sent: Monday, May 01, 2006 7:39 PM
Subject: [ntfsd] Copy NTFS compressed files without decompression
> As far as I know there is no way of copying NTFS
> compressed files from one NTFS volume to another NTFS
> volume without decompressing them.
>
> However, this would be useful in some cases (reducing
> copy operation time, saving bandwith etc.), so do any
> of you know if this is somehow possible?
>
> Regards,
> Razvan
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> —
> Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17
>
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>> Create the target file as compressed.
Can you elaborate on that? How would that eliminate
the need of decompressing the read buffer from the
source fiile in order to write and compress it to the
target file?
It wouldn’t. It just lets the target file be compressed too.
But this is user mode level, I don’t think it can be reached
in kernel mode, unless there’s both read FSCTL (Max wrote about that)
and write FSCTL for compressed data (I don’t know if there is)
L.
— Ladislav Zezula wrote:
> It wouldn’t. It just lets the target file be
> compressed too.
> But this is user mode level, I don’t think it can be
> reached
> in kernel mode, unless there’s both read FSCTL (Max
> wrote about that)
> and write FSCTL for compressed data (I don’t know if
> there is)
>
There is no problem with it being a user-mode level
solution. I was thinking of copying a file directly in
compressed form so as to remove the time required by
decompression on read and compression on write, but I
don’t know if this is possible anyhow. I looked into
CopyFile/CopyFileEx documentation but there are no
flags which I could specify as to allow that.
I asked this because some of you may have thought
about it before and probably know if it is possible or
not. However, it is just a thought, so I find an
answer of “impossible”/“not possible with current
design” also acceptable.
Regards,
Razvan
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Hello
Never tried this solution, but logically it should work:
- using undocumented NT Defrag API , gather all the file’s cluster on the
NTFS volume
- sum the cluster sizes and create an empty file on target drive with that
size
- start reading the clusters (by opening the disk volume and seeking to
cluster’s location
- write the dispersed (from the source drive) clusters sequentially into
the target file
By doing sector reads on source drive, you bypass NTFS decompression
routine, then by writing those sectors into a normal file, you should get
the same file contents on the target drive.
HTH
Elias
“Razvan Hobeanu” wrote in message
news:xxxxx@ntfsd…
> As far as I know there is no way of copying NTFS
> compressed files from one NTFS volume to another NTFS
> volume without decompressing them.
>
> However, this would be useful in some cases (reducing
> copy operation time, saving bandwith etc.), so do any
> of you know if this is somehow possible?
>
> Regards,
> Razvan
> 1. using undocumented NT Defrag API
Already documented.
By doing sector reads on source drive, you bypass NTFS decompression
routine, then by writing those sectors into a normal file, you should get
the same file contents on the target drive.
OK, then re-create the compression-related metadata for the file 
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com
“Maxim S. Shatskih” wrote in message
news:xxxxx@ntfsd…
>> 1. using undocumented NT Defrag API
>
> Already documented.
>
>> By doing sector reads on source drive, you bypass NTFS decompression
>> routine, then by writing those sectors into a normal file, you should get
>> the same file contents on the target drive.
>
> OK, then re-create the compression-related metadata for the file 
>
Yes, just realized that the file would be created with the compressed
contents but not accessible as if it was compressed! 
–
Elias