阅读:2965回复:24
*77分的问题*
如何动态增加镜像文件的大小,但不能改变其原有内容!
|
|
|
沙发#
发布于:2005-02-03 13:13
要编译上面的一段代码,需要在MACR中添加宏定义
#define _WIN32_WINNT 0x0500 如果使用vc环境,需要的setting中添加 |
|
板凳#
发布于:2004-04-13 11:02
SPARSE FILE是ipstore的标准做法。
|
|
|
地板#
发布于:2004-04-10 10:03
不行
|
|
|
地下室#
发布于:2004-04-10 09:35
fat形式的就不行吗?
|
|
|
5楼#
发布于:2004-04-09 15:17
先向系统传递一个假的大小(比如说40G),等实际写到后面的时候再动态增加文件的大小。
你可以考虑一下VPC是怎么做的 |
|
6楼#
发布于:2004-04-09 14:45
不过只能NTFS的分区上使用,如果在FAT32的分区创建文件则无效,
估计是NTFS的FILE SYSTEM里的做了什么处理。 |
|
|
7楼#
发布于:2004-04-09 14:40
在msdn中搜索一下sparse files。
|
|
|
8楼#
发布于:2004-04-09 14:36
FileDisk can use sparse files as disk images. A sparse file is a file were suficiently large blocks of zeros isn't allocated disk space. You can create sparse files with the tool mksparse.zip. To see how much disk space a file actually uses right click on the file and choose properties. If you for example creates a sparse file of 4GB, mounts it in FileDisk and formats it to NTFS, it will only take up 24MB on disk but looks like a normal disk of 4GB. When you copy files to it the used disk space will automatically increase.
http://www.insidewindows.info/mksparse.zip http://www.insidewindows.info 这个我到是没有在意。 如果是这样的话,你的问题就解决了。 |
|
|
9楼#
发布于:2004-04-09 14:23
有最新版??里面有动态增加,还是格式化??我怎么找了还是旧的??
给个连接,谢谢!! :o :o :o :o 一样要分加!! [编辑 - 4/9/04 by Zhujnt] |
|
|
10楼#
发布于:2004-04-09 14:01
画蛇添足,看看最新版的FILEDISK是如何做的吧。。。。
|
|
|
11楼#
发布于:2004-04-09 13:44
老大,我想到好方法了,直接在应用层做。首先我们再建一个虚拟磁盘(空间要大哟)。然后直接对它格式化,再将原来那虚拟磁盘里的内容全部读出来,放到刚虚拟的磁盘中来。再把原来的虚拟磁盘撤销掉,这样相当于动态增加了它的大小!!
现在的问题是: 我格式化它的时候,老是跳出格式化对话,能不跳出就可以了。老大,你说呢??当然,分数还是要给你加的 :D http://expert.csdn.net/Expert/topic/2945/2945231.xml?temp=.9005091 [编辑 - 4/9/04 by Zhujnt] |
|
|
12楼#
发布于:2004-04-09 09:32
解决这个问题的方法,
安装最新版本的sdk(vc6的的头文件和库太老),使用其头文件和库。 |
|
|
13楼#
发布于:2004-04-08 20:53
http://expert.csdn.net/Expert/topic/2941/2941608.xml?temp=.5400659
我早就把这代码贴在CSDN上了,因为我通不过编译, GetVolumeNameForVolumeMountPoint SetVolumeMountPoint 提示:没有定义,郁闷,我把可能的头文件都加了。 可惜,上面到现在都没有回复的 :( |
|
|
14楼#
发布于:2004-04-08 18:27
声明不是我写的,msdn中自带的
|
|
|
15楼#
发布于:2004-04-08 18:26
Mounting a Volume at a Mount Point
The following sample demonstrates how to mount a file system. This sample uses the following functions: GetVolumeNameForVolumeMountPoint and SetVolumeMountPoint. #define _WIN32_WINNT 0x0500 #include <windows.h> #include <stdio.h> #define BUFSIZE 1024 // ample space for our string buffer void Syntax (char *argv) { printf( "%s, mount a volume at a mount point.\n", argv ); printf( "For example, \"mount c:\\mnt\\fdrive\\ f:\\\"\n" ); } int main( int argc, char *argv[] ) { BOOL bFlag; char Buf[BUFSIZE]; // temporary buffer for volume name if( argc != 3 ) { Syntax( argv[0] ); return( -1 ); } // We should do some error checking on the inputs. Make sure // there are colons and backslashes in the right places, etc. bFlag = GetVolumeNameForVolumeMountPoint( argv[2], // input volume mount point or directory Buf, // output volume name buffer BUFSIZE // size of volume name buffer ); if (bFlag != TRUE) { printf( "Retrieving volume name for %s failed.\n", argv[2] ); return (-2); } printf( "Volume name of %s is %s\n", argv[2], Buf ); bFlag = SetVolumeMountPoint( argv[1], // mount point Buf // volume to be mounted ); if (!bFlag) printf ("Attempt to mount %s at %s failed.\n", argv[2], argv[1]); return (bFlag); } |
|
|
16楼#
发布于:2004-04-08 16:26
等我试成功了绝对说话算数,谢谢回答!
SetVolumeMountPoint是在应用程序中?但头文件没有! msdn中说是windows.h,但我试了没用! [编辑 - 4/8/04 by Zhujnt] |
|
|
17楼#
发布于:2004-04-08 16:05
SetVolumeMountPoint
快快给分啊。 :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D |
|
|
18楼#
发布于:2004-04-08 09:44
不管你的想法是对还是错,再奖励你10分!等我试成功再加分。
不过如何把这个分区挂到原先的那个分区的一个目录下呢? 稍详细一点,我还是个菜鸟!谢谢! 疑! 加分的按钮怎么没了?? [编辑 - 4/8/04 by Zhujnt] |
|
|
19楼#
发布于:2004-04-08 09:29
驱动中设置文件的大小:
IRP_MJ_SET_INFORMATION的FilePositionInformation |
|
|
上一页
下一页