Hi, is there any way that I can create/write a file sequentially on the hard
drive? By specifying FILE_FLAG_SEQUENTIAL_SCAN in CreateFile()? Thanks
This flag is used to help out in caching behavior.
What is it that you really want to achieve? If you simply want to keep
writing to a file in chunks of X bytes one after another, then you can do it
even without this flag. With this flag, if those offsets are already present
in the file, the cache manager will do some read ahead and cache the data so
that when you try to update it (using cached write operation), it will be
faster since it will be in the cache. But if you want to ensure that blocks
on disk are allocated in sequence, itβs not possible.
Regards,
Ayush Gupta
AI Consulting
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Michael Zhu
Sent: Tuesday, March 30, 2010 1:42 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Create/write a file sequentially on the hard drive
Hi, is there any way that I can create/write a file sequentially on the hard
drive? By specifying FILE_FLAG_SEQUENTIAL_SCAN in CreateFile()? Thanks
β NTFSD is sponsored by OSR For our schedule of debugging and file system
seminars (including our new fs mini-filter seminar) visit:
http://www.osr.com/seminars To unsubscribe, visit the List Server section of
OSR Online at http://www.osronline.com/page.cfm?name=ListServer
Yes. I just want to create and write a file which will be sequentially
stored on the disk. There should be a way to implement this. I know someone
did this before. Anyway, thanks for the info.
On Mon, Mar 29, 2010 at 4:43 PM, Ayush Gupta wrote:
> This flag is used to help out in caching behavior.
>
> What is it that you really want to achieve? If you simply want to keep
> writing to a file in chunks of X bytes one after another, then you can do it
> even without this flag. With this flag, if those offsets are already present
> in the file, the cache manager will do some read ahead and cache the data so
> that when you try to update it (using cached write operation), it will be
> faster since it will be in the cache. But if you want to ensure that blocks
> on disk are allocated in sequence, it?s not possible.
>
>
>
> Regards,
>
> Ayush Gupta
>
> AI Consulting
>
>
>
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] *On Behalf Of *Michael Zhu
> Sent: Tuesday, March 30, 2010 1:42 AM
> To: Windows File Systems Devs Interest List
> Subject: [ntfsd] Create/write a file sequentially on the hard drive
>
>
>
> Hi, is there any way that I can create/write a file sequentially on the
> hard drive? By specifying FILE_FLAG_SEQUENTIAL_SCAN in CreateFile()? Thanks
> β NTFSD is sponsored by OSR For our schedule of debugging and file system
> seminars (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars To unsubscribe, visit the List Server section
> of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
>
> β
> NTFSD is sponsored by OSR
>
> For our schedule of debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
One option is to do what De-fragmentation does.
It uses FSCTL_MOVE_FILE.
Check out the documentation here
http://msdn.microsoft.com/en-us/library/aa364577(VS.85).aspx
However, one needs to be careful when doing such things.
(Remarks section in the documentation has more information).