Cross-platform file mapping

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Cross-platform file mapping

Post by Mistrel »

File mapping is a great way to copy data from disk to disk without having to first load it into memory. This is an excellent feature of the Windows API and I believe Linux support it as well. It would be great to see a cross-platform solution in PureBasic for this.
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

+1
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

they improved the file operations by adding a read/write cache to v4.00, so i doubt they are going to rewrite the whole set again, sometime soon. the lib is very fast now (imho) and the question is, how much faster is it going to be, when they switch to file mapping?

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Cross-platform file mapping

Post by Trond »

Mistrel wrote:File mapping is a great way to copy data from disk to disk without having to first load it into memory. This is an excellent feature of the Windows API and I believe Linux support it as well. It would be great to see a cross-platform solution in PureBasic for this.
Can't you just use CopyFile() for that?
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: Cross-platform file mapping

Post by Mistrel »

Trond wrote:Can't you just use CopyFile() for that?
CopyFile() isn't useful if I want to copy only a portion of the file.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Actually, if you want to copy between multiple disks the data would be bound to go through memory somewhen. The difference is just who does it. It won't bring a big speed increase.
Post Reply