[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
##############################################################################
###+--------------+###########################################################
#+-| FIND_FSIZE() |----------------------------------------+##################
#| +--------------+ Returns the filesize of the file found |##################
#+---------------------------------------------------------+##################
##############################################################################
##############################################################################
#+--| Summary |----------------+##############################################
#| #INCLUDE system.hdr |##############################################
#+-----------------------------+##############################################
##############################################################################
##############################################################################
#+--| Syntax |--------------------------------+###############################
#| FUNCTION LONG find_fsize PROTOTYPE |###############################
#+--------------------------------------------+###############################
##############################################################################
##############################################################################
#########+---| Description |-----------------------------------------+########
#########| The find_fsize() function returns the filesize associated |########
#########| with the file found by the find_first() or find_next() |########
#########| functions. |########
#########+-----------------------------------------------------------+########
##############################################################################
##############################################################################
#########+--| Example 1 |-------------------------------------------+#########
#########| * This function returns the diskspace required |#########
#########| * by the specified files. |#########
#########| |#########
#########| FUNCTION ULONG filespace |#########
#########| PARAMETERS CONST CHAR filespec, VALUE INT type |#########
#########| VARDEF |#########
#########| ULONG space |#########
#########| ENDDEF |#########
#########| |#########
#########| space = 0 |#########
#########| IF find_first( filespec, type ) |#########
#########| REPEAT |#########
#########| space = space + find_fsize() |#########
#########| UNTIL .NOT. find_next() |#########
#########| ENDIF |#########
#########| RETURN space |#########
#########| |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
##############################################################################
#########+--| Example 2 |-------------------------------------------+#########
#########| * Place into a database all files greater than 1mb. |#########
#########| |#########
#########| FUNCTION LOGICAL got_big_file |#########
#########| PARAMETERS VALUE ULONG size |#########
#########| |#########
#########| DO WHILE find_fsize() < size |#########
#########| IF .NOT. find_next() |#########
#########| RETURN |#########
#########| ENDIF |#########
#########| ENDDO |#########
#########| |#########
#########| ENDPRO |#########
#########| |#########
#########| PROCEDURE get_big_files |#########
#########| PARAMETERS VALUE ULONG fsize |#########
#########| |#########
#########| IF find_first("*.dbf", 0x20 ) |#########
#########| DO WHILE got_big_file( fsize ) |#########
#########| APPEND BLANK |#########
#########| REPLACE f->name WITH find_fstr() |#########
#########| REPLACE f->name WITH find_fsize() |#########
#########| ENDDO |#########
#########| ENDIF |#########
#########| ENDPRO |#########
#########+----------------------------------------------------------+#########
##############################################################################
See Also:
find_fattr()
find_fdate()
find_fext()
...
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson