home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
stazsoftware.com
/
www.stazsoftware.com.tar
/
www.stazsoftware.com
/
futurebasic
/
sample-code
/
FlushVolume.sit
/
FlushVol
next >
Wrap
Text File
|
2003-08-22
|
1KB
|
38 lines
'~'A
' Runtime : Rntm Appearance.Incl
' CPU : Carbon
' CALL Req'd : Off
'~'B
/*
if you are writing an application that sends information to a server,
you will often need to flush the disk cache so that info is written
to the server, rather than sitting around in memory on a remote
machine. all you need to do is call fn FlushFileVol with a file spec.
the file spec can be an file that is on the volume. usually. it is the file
that you are working with and want to have sent off to the server.
this was written by rp.
*/
// flush the volume that the file belongs to
local mode
local fn FlushFileVol( f as ^FSSpec )
'~'1
dim paramBlock.64 // VolumeParam
BlockZero( @paramBlock, sizeof( paramBlock ) )
paramBlock.ioVRefNum% = f.vRefNum
end fn = fn PBFlushVolSync( paramBlock )
// demo main program
'~'1
dim as FSSpec f
long if ( files$( _FSSpecOpen,,, f ) != "" )
fn FlushFileVol( f )
end if