Change file size
-
Hi, Does anyone know how I could change the size description of a file without affecting the physical size. For example we could change a file's access date/time with "File.SetLastAccessTime(Path, AccessedDateTime)". I tried the following but it used/reserved the disk space I specified with sizeInBytes. fs = New System.IO.FileStream(Path, IO.FileMode.Open) fs.SetLength(sizeInBytes) Really i would like to make a 0 byte file look like 10mb for example. Thanks Wes...
-
Hi, Does anyone know how I could change the size description of a file without affecting the physical size. For example we could change a file's access date/time with "File.SetLastAccessTime(Path, AccessedDateTime)". I tried the following but it used/reserved the disk space I specified with sizeInBytes. fs = New System.IO.FileStream(Path, IO.FileMode.Open) fs.SetLength(sizeInBytes) Really i would like to make a 0 byte file look like 10mb for example. Thanks Wes...
Then your going to have to fill it or reserve the 10MB worth of nothing and yes, it will actually take up the disk space. The size is not a kind of description attribute of the file, but rather the actual size of the file returned by the file system. RageInTheMachine9532
-
Then your going to have to fill it or reserve the 10MB worth of nothing and yes, it will actually take up the disk space. The size is not a kind of description attribute of the file, but rather the actual size of the file returned by the file system. RageInTheMachine9532
That's too bad. However, I have seen this done before. The software that does it is DiskXtender by EMC/Legato. They are able to display a fake value in the size field. DiskXtender is a HSM product that basically migrates the original file's data to tape storage and leaves a stub file behind that looks identical to the original except for the actual size. Thanks, Wes...
-
That's too bad. However, I have seen this done before. The software that does it is DiskXtender by EMC/Legato. They are able to display a fake value in the size field. DiskXtender is a HSM product that basically migrates the original file's data to tape storage and leaves a stub file behind that looks identical to the original except for the actual size. Thanks, Wes...
This is possible because DiskXtender installs an extension to the file system called a a file system filter and uses blocks of data call Reparse Points. The reparse point is essentially a block of data attached to a file that describes additional attributes, or whatever else you want. When the file is opened or you get properties on it, the attached reparse point data is sent to the file system filter that understands it, then the filter gets to do whatever it needs to, like get the actual file from an offline storage device. Look here[^] for more information on Reparse Points. For more information on Installable File Systems, the documentation and SDKs are here[^]. RageInTheMachine9532
-
This is possible because DiskXtender installs an extension to the file system called a a file system filter and uses blocks of data call Reparse Points. The reparse point is essentially a block of data attached to a file that describes additional attributes, or whatever else you want. When the file is opened or you get properties on it, the attached reparse point data is sent to the file system filter that understands it, then the filter gets to do whatever it needs to, like get the actual file from an offline storage device. Look here[^] for more information on Reparse Points. For more information on Installable File Systems, the documentation and SDKs are here[^]. RageInTheMachine9532
-
Thank Rage...This is exatly what I am looking for. One other question: Do you know how to access the DeviceIOControl in VB? All the examples I've seen so far are in C++. Thanks, Wes...
Hi, I gave the following a try but got nowhere. Could someone assist pls. ================================================================== Imports System.Runtime.InteropServices Private Declare Auto Function CreateFile Lib "kernel32" _ Alias "CreateFileA" ( _ ByVal lpFileName As FileInfo, _ ByVal hTemplate As Long, _ ByVal dwDesiredAccess As Long, _ ByVal dwShareMode As Long, _ ByVal lpSecurityAttributes As Long, _ ByVal dwCreationDisposition As Long _ ) As Long Public Declare Ansi Function DeviceIoControl Lib "kernel32" ( _ ByVal hFile As String, _ ByVal dwIoControlCode As Integer, _ ByVal lpInBuffer As Integer, _ ByVal nInBufferSize As Integer, _ ByVal lpOutBuffer As Integer, _ ByVal nOutBufferSize As Integer, _ ByRef lpBytesReturned As Integer, _ ByVal lpOverlapped As Integer) As Boolean Const CREATE_ALWAYS = 2 Const GENERIC_READ = &H80000000 Const GENERIC_WRITE = &H40000000 Sub command1_Click() dim h h = File.Open("d:\test.txt", FileMode.Create) DeviceIoControl(wes, FSCTL_SET_SPARSE, NULL, 0, NULL, 0, 84, 0) end sub ================================================================== Thanks...