---------------------------------------------------------------------- --- Knud van Eeden --- 22 November 2009 - 01:38 pm ------------------- TSE: File: Search: FileName: File: Compress: Zip: Jar: How to: How to search for a filename on disk in .jar and .zip files in TSE? --- A .jar file is a special case of a .zip file, and has the same structure. === So a .zip search can also handle a .jar search. --- The program reads the start text content of each file (using the usual recursive 'walk the directory tree' method to read files), and uses the fixed structure of the .zip and .jar files to extract the filenames verbatim stored in it. === Steps: Overview: 1. -E.g. create the following program: --- cut here: begin --------------------------------------------------// filenamemacro=searfizj.s--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------// PROC PROCFileSearchFilenameCompressZipJar( STRING fileNameS, STRING directoryS )--- cut here: end ---------------------------------------------------- --- cut here: begin --------------------------------------------------FORWARD INTEGER PROC FNHistoryCheckAskCentralB( STRING s1, VAR STRING s2, INTEGER i1 ) FORWARD INTEGER PROC FNKeyCheckPressEscapeB( STRING s1 ) FORWARD INTEGER PROC FNMathCheckGetLogicFalseB() FORWARD INTEGER PROC FNMathCheckInitializeNewBooleanFalseB() FORWARD INTEGER PROC FNMathCheckLogicNotB( INTEGER i1 ) FORWARD INTEGER PROC FNMathGetBin2I( STRING s1 ) FORWARD INTEGER PROC FNMathGetBin2lI( STRING s1 ) FORWARD INTEGER PROC FNStringCheckEmptyB( STRING s1 ) FORWARD INTEGER PROC FNStringCheckEmptyNotB( STRING s1 ) FORWARD INTEGER PROC FNStringCheckEqualB( STRING s1, STRING s2 ) FORWARD MENU MENUFileSearchFilenameZipSearch() FORWARD PROC Main() FORWARD PROC PROCFileSearchFilenameCompressZipJar( STRING s1, STRING s2 ) FORWARD PROC PROCFileSearchFilenameFindDirs( STRING s1 ) FORWARD PROC PROCFileSearchFilenameLookInDir( STRING s1 ) FORWARD PROC PROCFileSearchFilenameSetZip( INTEGER i1 ) FORWARD PROC PROCFileSearchFilenameZipLook( STRING s1 ) FORWARD PROC PROCFileSearchFilenameZipRead( STRING s1 ) FORWARD STRING PROC FNStringGetDosDateS( STRING s1 ) FORWARD STRING PROC FNStringGetDosTimeS( STRING s1 ) FORWARD STRING PROC FNStringGetEmptyS() FORWARD STRING PROC FNStringGetEscapeS() FORWARD STRING PROC FNStringGetHistoryInputS( STRING s1, STRING s2, INTEGER i1 ) FORWARD STRING PROC FNStringGetInitializeNewStringS() FORWARD STRING PROC FNStringGetInputS( STRING s1, STRING s2 ) FORWARD STRING PROC FNStringGetSearchHistoryFindInputS( STRING s1, STRING s2 ) FORWARD STRING PROC FNStringGetStrTranS( STRING s1, STRING s2, STRING s3 ) // --- MAIN --- // // STRING cTmpLine[ MAXSTRINGLEN ] = "" // used all over the place so do not expect it to hold a value for very long STRING fileToFind[ _MAX_PATH_ ] = "" STRING zfileToFind[ _MAX_PATH_ ] = "" STRING file_date[ 8 ] = "" STRING file_time[ 8 ] = "" INTEGER lLookInZip = TRUE INTEGER zipBufferID = -1 INTEGER originalBufferID INTEGER outputBufferID INTEGER canceling = FALSE CONSTANT HEADER_SIZE = 30 STRING cZipHeader[ HEADER_SIZE ] // PROC Main() // STRING s1[255] = FNStringGetInitializeNewStringS() // STRING s2[255] = FNStringGetInitializeNewStringS() // s1 = FNStringGetInputS( "file: search: filename: compress: zip: jar: fileToFind = ", "" ) // IF FNKeyCheckPressEscapeB( s1 ) RETURN() ENDIF // s2 = FNStringGetInputS( "file: search: filename: compress: zip: jar: directory = ", "" ) // IF FNKeyCheckPressEscapeB( s2 ) RETURN() ENDIF // PROCFileSearchFilenameCompressZipJar( s1, s2 ) // END // <F12> Main() // --- LIBRARY --- // // library: string: initialize [kn, ri, mo, 09-07-2001 12:00:07] STRING PROC FNStringGetInitializeNewStringS() RETURN( FNStringGetEmptyS() ) END // library: input: input a string [kn, ni, ma, 03-08-1998 13:04:18] STRING PROC FNStringGetInputS( STRING askS, STRING answerDefaultS ) // e.g. PROC Main() // e.g. Message( FNStringGetConcat3S( "'", FNStringGetInputS( "Choose option (Y/n)", "Y" ), "'" ) ) // gives e.g. "Y" // e.g. END // e.g. // e.g. <F12> Main() RETURN( FNStringGetSearchHistoryFindInputS( askS, answerDefaultS ) ) END // library: key: check: press: escape (input: escape: test if escape was pressed) <version>1.0.0.0.0</version> (filenamemacro=checkepe.s) [kn, ni, wo, 05-08-1998 20:29:00] INTEGER PROC FNKeyCheckPressEscapeB( STRING s ) // version with testing local variable // e.g. PROC Main() // e.g. Message( FNKeyCheckPressEscapeB( "" ) ) // version with testing local variable ) // gives e.g. FALSE // e.g. END // e.g. // e.g. <F12> Main() RETURN( FNStringCheckEqualB( s, FNStringGetEscapeS() ) ) END // library: file: search: filename: compress: zip: jar <description></description> <version>1.0.0.0.9</version> (filenamemacro=searfizj.s) [kn, ri, su, 22-11-2009 12:18:01] PROC PROCFileSearchFilenameCompressZipJar( STRING fileNameS, STRING directoryS ) // e.g. // // e.g. STRING cTmpLine[ MAXSTRINGLEN ] = "" // used all over the place so do not expect it to hold a value for very long // e.g. STRING fileToFind[ _MAX_PATH_ ] = "" // e.g. STRING zfileToFind[ _MAX_PATH_ ] = "" // e.g. STRING file_date[ 8 ] = "" // e.g. STRING file_time[ 8 ] = "" // e.g. INTEGER lLookInZip = TRUE // e.g. INTEGER zipBufferID = -1 // e.g. INTEGER originalBufferID // e.g. INTEGER outputBufferID // e.g. INTEGER canceling = FALSE // e.g. CONSTANT HEADER_SIZE = 30 // e.g. STRING cZipHeader[ HEADER_SIZE ] // e.g. // // e.g. PROC Main() // e.g. // // e.g. STRING s1[255] = FNStringGetInitializeNewStringS() // e.g. // // e.g. STRING s2[255] = FNStringGetInitializeNewStringS() // e.g. // // e.g. s1 = FNStringGetInputS( "file: search: filename: compress: zip: jar: fileToFind = ", "" ) // e.g. // // e.g. IF FNKeyCheckPressEscapeB( s1 ) RETURN() ENDIF // e.g. // // e.g. s2 = FNStringGetInputS( "file: search: filename: compress: zip: jar: directory = ", "" ) // e.g. // // e.g. IF FNKeyCheckPressEscapeB( s2 ) RETURN() ENDIF // e.g. // // e.g. PROCFileSearchFilenameCompressZipJar( s1, s2 ) // e.g. // // e.g. END // e.g. // // e.g. <F12> Main() // // === // // This macro is adapted from the macro ff.s, originally created by author Peter Birch // // === // // Changelist // // -Reformatted source code to allow for automatic compilation + version control + unit testing + pretty print [kn, ri, su, 22-11-2009 13:24:48] // // -Added directory input [kn, ri, su, 22-11-2009 13:24:48] // // -Replaced characters ascii 1, 2, 3, 4 by equivalent Chr(1), Chr(2), Chr(3), Chr(4) [kn, ri, su, 22-11-2009 13:24:48] // // -Added filename and directory input passing as parameter [kn, ri, su, 22-11-2009 13:24:48] // // -Added _FIND_HISTORY_ to Ask() [kn, ri, su, 22-11-2009 13:24:48] // // === // // A starter macro to show some fun things that can be done with // SAL and ff.inc that comes with TSGREP (wp.bin can also be used.) // // This macro will dump the found file names into the current // buffer! // // a TSE file find macro // // // ************************************************************************** // // typedef struct // { // char ID[ 4]; // 1 zip ID // char x1[ 4]; // 5 // int nMethod; // 9 compression method // int orig_time; // 11 original file time // int orig_date; // 13 original file date // char x2[ 4]; // 15 there's got to be some attributes in here somewhere // long comp_size; // 19 compressed size // long uncomp; // 23 uncompressed size // int fn_size; // 27 file name length // int extra; // 29 some extra space for me to skip over // } ZIP; // total of 30 bytes // // directly after the header is comp_size bytes containing the compressed file // // IF nMethod == 0, then the file is just "stored" and can be directly // extracted (just copy to the bytes to a new file with the name given // in the zip) // originalBufferID = GetBufferId() // canceling = FALSE // fileToFind = Upper( fileNameS ) // MENUFileSearchFilenameZipSearch() // outputBufferID = CreateTempBuffer() // IF ( lLookInZip ) // fix up the name of the file to find for regx zfileToFind = FNStringGetStrTranS(fileToFind, ".", "\.") zfileToFind = FNStringGetStrTranS(zfileToFind, "?", ".") zfileToFind = FNStringGetStrTranS(zfileToFind, "*", ".*") zipBufferID = CreateTempBuffer() ENDIF // // start in that directory and work out // PROCFileSearchFilenameFindDirs( AddTrailingSlash( directoryS ) ) // IF ( lLookInZip ) AbandonFile(zipBufferID) ENDIF // // show the results // GotoBufferId(outputBufferID) // IF ( NOT lFind( ".", "igv" ) ) // Warn( "No files found" ) // ENDIF // GotoBufferId( originalBufferID ) // UpdateDisplay( _DEFAULT_ ) // END // library: string: get: empty (return an empty string) <version>1.0.0.0.0</version> (filenamemacro=getstgem.s) [kn, ri, za, 20-05-2000 20:11:03] STRING PROC FNStringGetEmptyS() // e.g. PROC Main() // e.g. Message( FNStringGetEmptyS() ) // gives e.g. ..."" // e.g. END // e.g. // e.g. <F12> Main() RETURN( "" ) END // library: input: input a string: history: find [kn, ri, sa, 25-08-2001 21:00:25] STRING PROC FNStringGetSearchHistoryFindInputS( STRING askS, STRING answerDefaultS ) RETURN( FNStringGetHistoryInputS( askS, answerDefaultS, _FIND_HISTORY_ ) ) END // library: string: equal: are two given strings equal? (stored in 'checstcf.s') [kn, zoe, wo, 04-10-2000 18:23:27] INTEGER PROC FNStringCheckEqualB( STRING s1, STRING s2 ) // e.g. PROC Main() // e.g. STRING s1[255] = FNStringGetInitializeNewStringS() // e.g. STRING s2[255] = FNStringGetInitializeNewStringS() // e.g. s1 = FNStringGetInputS( "string: check: equal: first string = ", "a" ) // e.g. IF FNKeyCheckPressEscapeB( s1 ) RETURN() ENDIF // e.g. s2 = FNStringGetInputS( "string: check: equal: second string = ", "a" ) // e.g. IF FNKeyCheckPressEscapeB( s2 ) RETURN() ENDIF // e.g. Message( FNStringCheckEqualB( s1, s2 ) ) // gives e.g. TRUE when string1 is equal to string2 // e.g. END // e.g. // e.g. <F12> Main() // // // <F12> PROCMessage( FNStringCheckEqualB( "knud", "knud" ) ) // gives TRUE // // <F12> PROCMessage( FNStringCheckEqualB( "knud", "van" ) ) // gives FALSE RETURN( s1 == s2 ) END // library: string: get: escape: input: escape: general output string to recognize an escape (e.g. in another routine). Central routine, only one occurrence of this constant string <version>1.0.0.0.0</version> (filenamemacro=getstges.s) [kn, ri, za, 05-12-1998 18:52:24] STRING PROC FNStringGetEscapeS() // e.g. PROC Main() // e.g. Message( FNStringGetEscapeS() ) // gives e.g. ..."" // e.g. END // e.g. // e.g. <F12> Main() RETURN( "<ESCAPE>" ) END // library: file: search: filename: zip: search <description></description> <version>1.0.0.0.0</version> (filenamemacro=searfizs.s) [kn, ri, su, 22-11-2009 12:54:44] MENU MENUFileSearchFilenameZipSearch() // e.g. PROC Main() // e.g. MENUFileSearchFilenameZipSearch() // e.g. END // e.g. // e.g. <F12> Main() // History "Search Zip and Jar Files?", , divide "&Yes", PROCFileSearchFilenameSetZip( TRUE ) "", , divide "&No", PROCFileSearchFilenameSetZip( FALSE ) END // library: string: get: str: tran <description></description> <version>1.0.0.0.0</version> (filenamemacro=getststr.s) [kn, ri, su, 22-11-2009 13:11:32] STRING PROC FNStringGetStrTranS( STRING pcOrig, STRING pcFrom, STRING pcTo ) // INTEGER i = 1 // INTEGER n = Length( pcOrig ) // STRING cRetval[ 18] = "" // REPEAT // CASE ( pcOrig[ i ] ) // WHEN pcFrom // cRetval = cRetval + pcTo // OTHERWISE // cRetval = cRetval + pcOrig[ i ] // ENDCASE // i = i + 1 // UNTIL ( i > n ) // RETURN( cRetval ) // END // library: file: search: filename: find: dirs <description></description> <version>1.0.0.0.0</version> (filenamemacro=searfifd.s) [kn, ri, su, 22-11-2009 13:09:04] PROC PROCFileSearchFilenameFindDirs( STRING pathName ) // INTEGER searchHandle = 0 // PROCFileSearchFilenameLookInDir( pathName ) // searchHandle = FindFirstFile( Format( pathName, "*" ), _DIRECTORY_ ) // IF (-1 <> searchHandle ) // REPEAT // IF ( ( FFAttribute() & _DIRECTORY_ ) AND ( SubStr( FFName(), 1, 1 ) <> "." ) ) // PROCFileSearchFilenameFindDirs( Format( pathName, FFName(), "\" ) ) // ENDIF // UNTIL ( NOT ( FindNextFile(searchHandle, _DIRECTORY_) ) OR ( canceling ) ) // FindFileClose( searchHandle ) // ENDIF // END // library: input: input a string [kn, ni, ma, 03-08-1998 13:04:18] STRING PROC FNStringGetHistoryInputS( STRING infoS, STRING answerDefaultS, INTEGER historyI ) // STRING s[255] = answerDefaultS // INTEGER escapeB = FNMathCheckInitializeNewBooleanFalseB() // escapeB = FNMathCheckLogicNotB( FNHistoryCheckAskCentralB( infoS, s, historyI ) ) // IF ( escapeB ) RETURN( FNStringGetEscapeS() ) ENDIF // <Escape> was pressed, in response // IF FNStringCheckEmptyB( s ) AND FNStringCheckEmptyNotB( answerDefaultS ) RETURN( FNStringGetEmptyS() ) // input of an empty string, user has removed the string to indicate that an empty string was wanted ENDIF // IF FNStringCheckEmptyB( s ) RETURN( answerDefaultS ) ENDIF // <Enter> was pressed, in response (variation: IF FNMathCheckLogicNotB( MathGetStringLengthI( s ) ) ...) // removed FN because it gave problems compiling [kn, ri, sa, 16-02-2008 21:53:49] // RETURN( s ) // response was entered // END // library: file: search: filename: set: zip <description></description> <version>1.0.0.0.0</version> (filenamemacro=searfisz.s) [kn, ri, su, 22-11-2009 12:53:47] PROC PROCFileSearchFilenameSetZip( INTEGER lSet ) // e.g. PROC Main() // e.g. PROCFileSearchFilenameSetZip( 0 ) // e.g. END // e.g. // e.g. <F12> Main() // lLookInZip = lSet // END // library: file: search: filename: look: in: dir <description></description> <version>1.0.0.0.0</version> (filenamemacro=searfiid.s) [kn, ri, su, 22-11-2009 13:06:11] PROC PROCFileSearchFilenameLookInDir( STRING pathName ) // INTEGER searchHandle = 0 // Message( Format( "Press <Esc> to cancel... Searching ", pathName ) ) // IF ( KeyPressed() ) // IF ( GetKey() == <Escape> ) // canceling = TRUE // ENDIF // ENDIF // IF ( lLookInZip ) // // search in all zip files in this directory // searchHandle = FindFirstFile(format( pathName, "*.ZIP" ), -1 ) // IF ( -1 <> searchHandle ) // REPEAT // PROCFileSearchFilenameZipLook( Format( pathName, FFName() ) ) // UNTIL ( NOT ( FindNextFile( searchHandle, -1 ) ) OR ( canceling ) ) // FindFileClose( searchHandle ) // ENDIF // // search in all jar files in this directory // searchHandle = FindFirstFile(format( pathName, "*.JAR" ), -1 ) // IF ( -1 <> searchHandle ) // REPEAT // PROCFileSearchFilenameZipLook( Format( pathName, FFName() ) ) // UNTIL ( NOT ( FindNextFile( searchHandle, -1 ) ) OR ( canceling ) ) // FindFileClose( searchHandle ) // ENDIF // ENDIF // searchHandle = FindFirstFile( Format( pathName, fileToFind ), -1 ) // IF ( -1 <> searchHandle ) // REPEAT // IF ( FFAttribute() & _DIRECTORY_ ) // cTmpLine = Format( "<DIR>":-11 ) // ELSE // // file size // cTmpLine = Format( FFSize():9, " " ) // ENDIF // file_date = FFDateStr() // file_time = FFTimeStr() // cTmpLine = Format( cTmpLine, file_date:-10, file_time:-10, pathName, FFName() ) // AddLine( cTmpLine, outputBufferID ) // UNTIL ( NOT ( FindNextFile(searchHandle, -1) ) OR ( canceling ) ) // FindFileClose( searchHandle ) // ENDIF // END // library: initialize: check: new: boolean: false <version>1.0.0.0.0</version> (filenamemacro=checinbf.s) [kn, ri, su, 22-07-2001 15:58:06] INTEGER PROC FNMathCheckInitializeNewBooleanFalseB() // e.g. PROC Main() // e.g. Message( FNMathCheckInitializeNewBooleanFalseB() ) // gives e.g. FALSE // e.g. END // e.g. // e.g. <F12> Main() RETURN( FNMathCheckGetLogicFalseB() ) END // library: math: check: logic: not <version>1.0.0.0.0</version> (filenamemacro=checmaln.s) [kn, ri, tu, 15-05-2001 16:54:21] INTEGER PROC FNMathCheckLogicNotB( INTEGER B ) // e.g. PROC Main() // e.g. STRING s[255] = FNStringGetInitializeNewStringS() // e.g. s = FNStringGetInputS( "math: check: logic: not: number = ", "1" ) // e.g. IF FNKeyCheckPressEscapeB( s ) RETURN() ENDIF // e.g. Message( FNMathCheckLogicNotB( FNStringGetToIntegerI( s ) ) ) // e.g. END // e.g. // e.g. <F12> Main() RETURN( NOT B ) END // library: input: ask: find history [kn, ri, sa, 25-08-2001 20:34:13] INTEGER PROC FNHistoryCheckAskCentralB( STRING askS, VAR STRING answerDefaultS, INTEGER historyI ) RETURN( Ask( askS, answerDefaultS, historyI ) ) END // library: string: empty: is given string empty? [kn, ri, za, 20-05-2000 20:11:08] INTEGER PROC FNStringCheckEmptyB( STRING s ) RETURN( FNStringCheckEqualB( s, FNStringGetEmptyS() ) ) END // library: string: check: empty: not <version>1.0.0.0.0</version> (filenamemacro=checstep.s) [kn, ri, su, 21-05-2006 22:32:11] INTEGER PROC FNStringCheckEmptyNotB( STRING s ) // e.g. PROC Main() // e.g. Message( FNStringCheckEmptyNotB( FNStringGetEmptyS() ) ) // gives e.g. FALSE // e.g. END // e.g. // e.g. <F12> Main() RETURN( FNMathCheckLogicNotB( FNStringCheckEmptyB( s ) ) ) END // library: file: search: zip: look <description></description> <version>1.0.0.0.0</version> (filenamemacro=searfizl.s) [kn, ri, su, 22-11-2009 12:43:21] PROC PROCFileSearchFilenameZipLook( STRING pcPath ) // GotoBufferId( zipBufferID ) // EmptyBuffer( zipBufferID ) // PROCFileSearchFilenameZipRead( pcPath ) // IF ( LFind( zfileToFind, "igx" ) ) // GotoLine(1) // GotoColumn(1) // WHILE ( lRepeatFind() ) // MarkLine() // cTmpLine = GetMarkedText() // UnMarkBlock() // cTmpLine = Format( cTmpLine, " <- ", pcPath ) // AddLine( cTmpLine, outputBufferID ) // ENDWHILE // ENDIF // GotoBufferId(originalBufferID) // END // library: math: check: get: logic: false: wrapper <version>1.0.0.0.0</version> (filenamemacro=checmalf.s) [kn, ri, su, 22-07-2001 15:43:08] INTEGER PROC FNMathCheckGetLogicFalseB() // e.g. PROC Main() // e.g. Message( FNMathCheckGetLogicFalseB() ) // gives e.g. ..."" // e.g. END // e.g. // e.g. <F12> Main() RETURN( FALSE ) END // library: file: search: filename: zip: read <description></description> <version>1.0.0.0.0</version> (filenamemacro=searfizr.s) [kn, ri, su, 22-11-2009 12:51:31] PROC PROCFileSearchFilenameZipRead( STRING pcZipFile ) // INTEGER iZipId = 0 // INTEGER comp_size = 0 // INTEGER uncomp = 0 // INTEGER fn_size = 0 // INTEGER extra = 0 // iZipId = fOpen( pcZipFile, _OPEN_READONLY_ ) // IF ( iZipId > -1 ) // WHILE ( TRUE ) // // read zip file header // IF ( HEADER_SIZE <> fRead( iZipId, cZipHeader, HEADER_SIZE ) ) // Break // ENDIF // IF ( SubStr( cZipHeader, 1, 4 ) == ( "PK" + Chr( 0 ) + Chr( 1 ) ) ) // Break // ELSEIF ( SubStr( cZipHeader, 1, 4 ) <> ( "PK" + Chr( 3 ) + Chr( 4 ) ) ) // Break // ENDIF // comp_size = FNMathGetBin2lI( SubStr( cZipHeader, 19, 4 ) ) // uncomp = FNMathGetBin2lI( SubStr( cZipHeader, 23, 4 ) ) // fn_size = FNMathGetBin2I( SubStr( cZipHeader, 27, 2 ) ) // extra = FNMathGetBin2I( SubStr( cZipHeader, 29, 2 ) ) // file_date = FNStringGetDosDateS( SubStr( cZipHeader, 13, 2 ) ) // file_time = FNStringGetDosTimeS( SubStr( cZipHeader, 11, 2 ) ) // fRead( iZipId, cTmpLine, fn_size ) // read file name // fSeek( iZipId, comp_size + extra, _SEEK_CURRENT_ ) // AddLine( Format( uncomp:9, file_date:10, file_time:10, " ", cTmpLine ), zipBufferID ) // ENDWHILE // fClose( iZipId ) // ENDIF // END // library: math: get: bin2l <description></description> <version>1.0.0.0.0</version> (filenamemacro=getmagbj.s) [kn, ri, su, 22-11-2009 12:37:34] INTEGER PROC FNMathGetBin2lI( STRING cTemp ) // RETURN( ( Asc( cTemp[ 4 ] ) Shl 24 ) | ( Asc( cTemp[ 3 ] ) Shl 16 ) | ( Asc( cTemp[ 2 ] ) Shl 8 ) | ( Asc( cTemp[ 1 ] ) ) ) // END // library: math: get: bin2 <description></description> <version>1.0.0.0.0</version> (filenamemacro=getmagbi.s) [kn, ri, su, 22-11-2009 12:35:40] INTEGER PROC FNMathGetBin2I( STRING cTemp ) // RETURN( ( Asc( cTemp[ 2]) Shl 8) | Asc( cTemp[ 1 ] ) ) // END // library: string: get: dos: date <description></description> <version>1.0.0.0.0</version> (filenamemacro=getstdda.s) [kn, ri, su, 22-11-2009 12:38:30] STRING PROC FNStringGetDosDateS( STRING pcDate ) // STRING cDate[ 8] = "" // INTEGER d = FNMathGetBin2I( pcDate ) // cDate = ( Format( ( ( d & 0x01E0 ) Shr 5 ) :2:'0', '/', ( d & 0x001F ) :2:'0', '/', ( ( ( ( d & 0xFE00 ) Shr 9 ) + 80 ) Mod 100 ):2:'0' ) ) // RETURN( cDate ) // END // library: string: get: dos: time <description></description> <version>1.0.0.0.0</version> (filenamemacro=getstdti.s) [kn, ri, su, 22-11-2009 12:41:00] STRING PROC FNStringGetDosTimeS( STRING pcTime ) // STRING cTime[ 8] = "" // INTEGER t = FNMathGetBin2I( pcTime ) // cTime = (Format( ( ( t & 0xf800 ) Shr 11 ) :2:'0', ':', ( ( t & 0x07e0 ) Shr 5 ) :2:'0', ':', ( ( t & 0x001f ) Shl 1 ) :2:'0' ) ) // RETURN( cTime ) // END--- cut here: end ---------------------------------------------------- 2. -Save the file as --- cut here: begin --------------------------------------------------searfizj.s--- cut here: end ---------------------------------------------------- 3. -Compile the program 4. -Run the program 5. -Input 1. -E.g. --- cut here: begin --------------------------------------------------filename to search = ddd1.txt--- cut here: end ---------------------------------------------------- 2. -E.g. --- cut here: begin --------------------------------------------------directory where to start the search from = \--- cut here: end ---------------------------------------------------- 3. -E.g. --- cut here: begin --------------------------------------------------choose 'Yes' to search also in .zip and .jar filenames--- cut here: end ---------------------------------------------------- 6. -That will show a screen output similar to the following: --- cut here: begin --------------------------------------------------1: 16806637 10/24/09 15:19:16 ddd1.txt <- c:\d\d.zip--- cut here: end ---------------------------------------------------- === Book: see also: === Diagram: see also: === File: see also: === Help: see also: === Image: see also:=== Internet: see also: --- Computer: Editor: Text: TSE: Directory: File: Directory: All: Operation: Get: Walk: The: Tree: Link: Can you give an overview of links? http://goo.gl/Iv38p === Podcast: see also: === Record: see also: === Screencast: see also: === Table: see also: === Video: see also: === <version>1.0.0.0.2</version> ----------------------------------------------------------------------
|