// // FILEINFO.VDM Ch. Ziemski 16.05.2001 // // Pop up a dialog box (Win) or a Message() (DOS) // with some infos about the current file (like DIR) // // // Uses $103 and #103 // Reg_Set(103, PATHNAME) // the file to check if((Reg_Size(103)==0) || (! File_Exist("|@(103)"))){ // if no filename or file doesn't exist alert() return } Sys("dir |@(103) > |(HOME)\FILEINFO.TMP",DOS+SIMPLE+OK+SUPPRESS) // get infos from OS via DIR #103=Buf_Num // Buf_Switch( Buf_Free(EXTRA) ) // open a new buffer File_Open("|(HOME)\FILEINFO.TMP",FORCE) // with the DIR output // // Remove header and trailer // Search(/|{directory|wof|w,Verzeichnis|wvon|w}/,ADVANCE+NOERR) if (Error_Flag) { Break_Out } End_Of_Line() Match("|[|W]|L",ADVANCE+ALL) Del_Line(-ALL) //Delete Header info End_Of_File(); Del_Line(-2) //Delete Trailer info BoF() if (Is_WinNT) { // 09.05.2001 21:59 13.599.466 Bigfile.dat Goto_Col(39) Del_Block(Cur_Pos, Eol_Pos) } else { // Bigfile dat 13.599.466 09.05.01 21:59 Bigfile.dat Goto_Col(45) // 44+1 ! Del_Block(Cur_Pos, Eol_Pos) BoF Del_Char(12) Replace(" +{[0-9,.]+} +{[0-9/.]+ +[0-9:]+[ap ]+}","\2 \1",REGEXP+NOERR) } // ==> date time size // // Format the output // BoF Ins_Text("Date: ") Search("|W") Ins_Newline(1) Replace("|W","") Ins_Text("Time: ") Search("|W") Ins_Newline(1) Replace("|W","") Ins_Text("Size: ") EoL Ins_Text(" bytes") Ins_Newline(1) BoF Reg_Ins(103) Ins_Newline(2) Replace_Block("\", "\\", 0, File_Size, BEGIN+ALL+NOERR) // to display backslashes in DI1() Reg_Copy_Block(103, 0, File_Size) if(Is_Win32_Version){ DI1(103,"`File Info`, `|@(103)`,`[OK]`", APP+CENTER, 0, 0) } else { Statline_Message("Press any key to continue...") Type_Newline(2) Get_Key(@103) Visual_Macro(NOMSG) } // clean up Buf_Quit(OK) File_Delete("|(HOME)\FILEINFO.TMP", OK+NOERR) Buf_Switch(#103) // end