From: George H. <geo...@us...> - 2006-03-13 14:16:57
|
Update of /cvsroot/win32forth/win32forth/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11615/win32forth/src Modified Files: ANSFILE.F Log Message: gah: More Dexing and added missing section of doc. Index: ANSFILE.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/ANSFILE.F,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ANSFILE.F 29 Aug 2005 15:56:27 -0000 1.3 --- ANSFILE.F 13 Mar 2006 14:16:51 -0000 1.4 *************** *** 1,6 **** \ $Id$ ! \ This was an ANSI file words set with extensions for finding files ! \ but the ANSI words were moved to the kernel \ \ The words defined in this file follow the draft proposed AMERICAN --- 1,6 ---- \ $Id$ ! \ *P These words are extensions to the ANSI file words for finding files. ! \ The ANSI words are defined in the kernel. \ \ The words defined in this file follow the draft proposed AMERICAN *************** *** 8,12 **** \ - June 30, 1993 \ ! \ If ior = 0, operation is O.K.; Otherwse, it is a failure. --- 8,12 ---- \ - June 30, 1993 \ ! \ ** If ior = 0, operation is O.K.; Otherwse, it is a failure. *************** *** 20,25 **** only forth also definitions ! cell newuser _hdl-search _hdl-search off --- 20,33 ---- only forth also definitions + 5 PROC GetDiskFreeSpace + 2 PROC FindFirstFile + 2 PROC FindNextFile + 1 PROC FindClose + 3 PROC FileTimeToDosDateTime + 4 PROC GetFileTime + 2 PROC FileTimeToSystemTime ! cell newuser _hdl-search ( -- addr ) ! \ *G Variable holding handle. _hdl-search off *************** *** 47,53 **** 16 Constant sizeof(_systemTime) ! 0 newuser _systemtime \ struct FileTimeToSystemTime ! \ function; this struc is same ! \ as time-buf in kernel.tom 2 newuser wYear 2 newuser wMonth --- 55,61 ---- 16 Constant sizeof(_systemTime) ! 0 newuser _systemtime ! \ *G Structure FileTimeToSystemTime ! \ ** function; this struc is same as time-buf in kernel.tom 2 newuser wYear 2 newuser wMonth *************** *** 59,69 **** 2 newuser wMilliseconds - - - \ Get a drive's free space, cluster and sector information - \ "zroot" is the root directory spec zString for the desired drive in the - \ format z" x:\", where x can be a, b, c, d or e etc... - 5 PROC GetDiskFreeSpace : get-fspace { zroot \ clus freclus b/sec s/clus -- as bs cs ds } &of clus \ lpClusters - bs &of freclus \ lpFreeClusters - as --- 67,74 ---- 2 newuser wMilliseconds : get-fspace { zroot \ clus freclus b/sec s/clus -- as bs cs ds } + \ *G Get a drive's free space, cluster and sector information + \ ** "zroot" is the root directory spec zString for the desired drive in the + \ ** format z" x:\", where x can be a, b, c, d or e etc... &of clus \ lpClusters - bs &of freclus \ lpFreeClusters - as *************** *** 77,85 **** then ; ! 2 PROC FindFirstFile ! : find-first-file ( adr slen -- adrd ior ) ! \ name(adr) - null-terminated valid directory or path and filename ! \ len - length of ascii name in bytes ! \ adrd - address of _win32-find-data struc max-path malloc dup>r ascii-z \ adrz - --- 82,90 ---- then ; ! ! : find-first-file ( addr1 len1 -- addr2 ior ) ! \ *G Name(addr1) - null-terminated valid directory or path and filename ! \ ** len1 - length of ascii name in bytes ! \ ** addr2 - address of _win32-find-data struc max-path malloc dup>r ascii-z \ adrz - *************** *** 93,99 **** r> release ; \ free buff ! 2 PROC FindNextFile ! : find-next-file ( -- adrd ior ) \ find-first-file word must be called ! \ before this word can be called due to that _hdl-search is needed _win32-find-data \ lpffd - _WIN32_FIND_DATA _hdl-search @ \ hFindFile --- 98,105 ---- r> release ; \ free buff ! ! : find-next-file ( -- addr ior ) ! \ *G Find-first-file word must be called ! \ ** before this word can be called due to that _hdl-search is needed _win32-find-data \ lpffd - _WIN32_FIND_DATA _hdl-search @ \ hFindFile *************** *** 102,107 **** swap 0= ; \ adrd ior - 0 = success ! 1 PROC FindClose ! : find-close ( -- ior ) \ close the _hdl-search handle _hdl-search @ call FindClose 0= ; \ ior - 0 = success --- 108,114 ---- swap 0= ; \ adrd ior - 0 = success ! ! : find-close ( -- ior ) ! \ *G Close the _hdl-search handle. _hdl-search @ call FindClose 0= ; \ ior - 0 = success *************** *** 109,113 **** internal ! 3 PROC FileTimeToDosDateTime : (DOSTime) ( n -- ) ptr-DOS-time ptr-DOS-date rot \ ptr's to 16 bit DOS time & date --- 116,120 ---- internal ! : (DOSTime) ( n -- ) ptr-DOS-time ptr-DOS-date rot \ ptr's to 16 bit DOS time & date *************** *** 119,136 **** : get-DOS-create-datetime ( -- ;convert 64 bit file time to MS_DOS ) \ date and time values ! \ need to call find-first-file or find-next-file word ! \ before using this word 1 (DOSTime) ; : get-DOS-access-datetime ( -- ;convert 64 bit file time to MS_DOS ) \ date and time values ! \ need to call find-first-file or find-next-file word ! \ before using this word 3 (DOSTime) ; : get-DOS-write-datetime ( -- ;convert 64 bit file time to MS_DOS ) \ date and time values ! \ need to call find-first-file or find-next-file word ! \ before using this word 5 (DOSTime) ; --- 126,143 ---- : get-DOS-create-datetime ( -- ;convert 64 bit file time to MS_DOS ) \ date and time values ! \ need to call find-first-file or find-next-file word ! \ before using this word 1 (DOSTime) ; : get-DOS-access-datetime ( -- ;convert 64 bit file time to MS_DOS ) \ date and time values ! \ need to call find-first-file or find-next-file word ! \ before using this word 3 (DOSTime) ; : get-DOS-write-datetime ( -- ;convert 64 bit file time to MS_DOS ) \ date and time values ! \ need to call find-first-file or find-next-file word ! \ before using this word 5 (DOSTime) ; *************** *** 138,154 **** : get-file-size ( -- size ) ! \ need to call find-first-file or find-next-file word ! \ before using this word _win32-find-data 8 cells+ @ ; : get-file-name ( -- adr; address for file name ) ! \ need to call find-first-file or find-next-file word ! \ before using this word _win32-find-data 11 cells+ ; 2 cells newuser file-time-buf ! 4 PROC GetFileTime ! 2 PROC FileTimeToSystemTime : get-file-modified ( fileid -- system-time ) >r --- 145,160 ---- : get-file-size ( -- size ) ! \ need to call find-first-file or find-next-file word ! \ before using this word _win32-find-data 8 cells+ @ ; : get-file-name ( -- adr; address for file name ) ! \ need to call find-first-file or find-next-file word ! \ before using this word _win32-find-data 11 cells+ ; 2 cells newuser file-time-buf ! : get-file-modified ( fileid -- system-time ) >r *************** *** 166,174 **** : filetime-to-systemtime ( cell# -- ; convert file time to system time ) ! \ need to call find-first-file or find-next-file word ! \ before using this word ! \ cell# is offset in number of cells to _win32-find-data ! \ 1 for creation time; 3 for access time; and 5 for write time ! \ normaly 5 should be used >r \ cell# -> rstack _systemtime \ struct FileTimeToSystemTime --- 172,180 ---- : filetime-to-systemtime ( cell# -- ; convert file time to system time ) ! \ need to call find-first-file or find-next-file word ! \ before using this word ! \ cell# is offset in number of cells to _win32-find-data ! \ 1 for creation time; 3 for access time; and 5 for write time ! \ normaly 5 should be used >r \ cell# -> rstack _systemtime \ struct FileTimeToSystemTime *************** *** 179,183 **** ' zcount alias asciiz->asc-len ( adrz -- sadr slen ) ! IN-SYSTEM --- 185,189 ---- ' zcount alias asciiz->asc-len ( adrz -- sadr slen ) ! IN-SYSTEM *************** *** 260,264 **** cr ." RENAME <filespec> <oldsubstring> <newsubstring>" EXIT \ leave if no names specified ! THEN cr ." Rename Files: " RenameFrom$ count type ." from: " --- 266,270 ---- cr ." RENAME <filespec> <oldsubstring> <newsubstring>" EXIT \ leave if no names specified ! THEN cr ." Rename Files: " RenameFrom$ count type ." from: " |