From: George H. <geo...@us...> - 2006-09-22 10:50:25
|
Update of /cvsroot/win32forth/win32forth/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15918/win32forth/src Modified Files: ANSFILE.F Log Message: gah:Adde more documentaion for ansfile Index: ANSFILE.F =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/ANSFILE.F,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ANSFILE.F 21 Sep 2006 12:50:17 -0000 1.7 --- ANSFILE.F 22 Sep 2006 10:50:20 -0000 1.8 *************** *** 1,4 **** --- 1,8 ---- \ $Id$ + \ *D doc + \ *! p-ansfile W32F ansfile + \ *T File and directory searching words. + \ *P These words are extensions to the ANSI file words for finding files. \ The ANSI words are defined in the kernel. *************** *** 28,31 **** --- 32,37 ---- 2 PROC FileTimeToSystemTime + \ *S Glossary + cell newuser _hdl-search ( -- addr ) \ *G Variable holding handle. *************** *** 108,112 **** r> release ; \ free buff - : find-next-file ( -- addr ior ) \ *G Find-first-file word must be called --- 114,117 ---- *************** *** 118,122 **** swap 0= ; \ adrd ior - 0 = success - : find-close ( -- ior ) \ *G Close the _hdl-search handle. --- 123,126 ---- *************** *** 135,168 **** : 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) ; ! : 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+ ; : dir-attribute? ( - flag ) \ *G Returns true when a file is a directory. \n ! \ ** Need to call find-first-file or find-next-file word before using this word. \n \ ** Can be used in combination with ForAllFileNames _win32-find-data @ FILE_ATTRIBUTE_DIRECTORY and ; --- 139,175 ---- : get-DOS-create-datetime ( -- ;convert 64 bit file time to MS_DOS ) ! \ *G Date and time values of creation. \n ! \ ** You need to call find-first-file or find-next-file word in the current task ! \ ** before using this word. 1 (DOSTime) ; : get-DOS-access-datetime ( -- ;convert 64 bit file time to MS_DOS ) ! \ *G date and time values of last access. \n ! \ ** You need to call find-first-file or find-next-file word in the current task ! \ ** before using this word. 3 (DOSTime) ; : get-DOS-write-datetime ( -- ;convert 64 bit file time to MS_DOS ) ! \ *G Date and time values of last write. \n ! \ ** You need to call find-first-file or find-next-file word in the current task ! \ ** before using this word. 5 (DOSTime) ; ! : get-file-size ( -- size ) \ W32F Files Extra ! \ *G Size of the last found file. \n ! \ ** You need to call find-first-file or find-next-file word in the current task ! \ ** before using this word. _win32-find-data 8 cells+ @ ; : get-file-name ( -- adr; address for file name ) ! \ *G get the name of the last found file. \n ! \ ** You need to call find-first-file or find-next-file word in the current task ! \ ** before using this word. _win32-find-data 11 cells+ ; : dir-attribute? ( - flag ) \ *G Returns true when a file is a directory. \n ! \ ** You need to call find-first-file or find-next-file word in the current task ! \ ** before using this word. \n \ ** Can be used in combination with ForAllFileNames _win32-find-data @ FILE_ATTRIBUTE_DIRECTORY and ; *************** *** 202,206 **** : dir->file-name ( -- adr count ) ! \ *G Returns the adres and count of a file in a directory. \n \ ** Need to call find-first-file or find-next-file word before using this word. \n \ ** Can be used in combination with ForAllFileNames --- 209,213 ---- : dir->file-name ( -- adr count ) ! \ *G Returns the address and count of a file in a directory. \n \ ** Need to call find-first-file or find-next-file word before using this word. \n \ ** Can be used in combination with ForAllFileNames *************** *** 254,257 **** --- 261,266 ---- then ; + dpr-warning? dpr-warning-off checkstack + : _print-dir-files ( adr slen -- ) 0 total-file-bytes ! *************** *** 270,273 **** --- 279,284 ---- REPEAT ; deprecated + to dpr-warning? + : .file-size-name ( adr len - ) \ *G Print the size or directory indication and the name of file. *************** *** 295,299 **** \ *G Print all the files and sub-directories in a directory that match a specific \ ** pattern. \n ! \ ** If "name" is missing or ends in \ search for all files that match *.* \n \ ** If "name" contains a relative path then it's relative to the current directory. \n \ ** If "name" ends in : assume a drive use "name"\*.* for the search pattern. \n --- 306,310 ---- \ *G Print all the files and sub-directories in a directory that match a specific \ ** pattern. \n ! \ ** If "name" is missing or ends in \ or / search for all files that match *.* \n \ ** If "name" contains a relative path then it's relative to the current directory. \n \ ** If "name" ends in : assume a drive use "name"\*.* for the search pattern. \n *************** *** 301,307 **** /parse-word dup c@ 0= \ if not spec given, use *.* IF s" *.*" pocket place ! THEN dup count + 1- c@ ':' = \ if just a drive, add \ IF s" \" pocket +place ! THEN dup count + 1- c@ '\' = \ if it ends in a \, add *.* IF s" *.*" pocket +place THEN count print-dir-files ; --- 312,319 ---- /parse-word dup c@ 0= \ if not spec given, use *.* IF s" *.*" pocket place ! THEN dup count + 1- c@ [char] : = \ if just a drive, add \ IF s" \" pocket +place ! THEN dup count + 1- c@ dup [char] \ \ if it ends in a \, ! swap [char] / = or \ or a /, add *.* IF s" *.*" pocket +place THEN count print-dir-files ; *************** *** 309,314 **** : do-rename-afile { RenamePart1$ RenamePart2$ \ RenameTemp$ -- } \ rename one file MAXSTRING LocalAlloc: RenameTemp$ ! _win32-find-data 11 CELLS+ \ adrz ! zcount \ adrz -- adr len 2dup 2dup RenamePart1$ count caps-search IF 2dup 2>r nip - RenameTemp$ place \ leading part --- 321,325 ---- : do-rename-afile { RenamePart1$ RenamePart2$ \ RenameTemp$ -- } \ rename one file MAXSTRING LocalAlloc: RenameTemp$ ! dir->file-name 2dup 2dup RenamePart1$ count caps-search IF 2dup 2>r nip - RenameTemp$ place \ leading part |