- Timestamp:
- Nov 2, 2009, 3:32:44 PM (16 years ago)
- Location:
- branches/guitools-2.0
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/guitools-2.0/evfsgui/changes
r345 r346 3 3 - Debug on/off option is badly implemented (rework required) 4 4 - Create Icon. stem in order to ease maintainance of icons 5 6 Version 2.0 beta4 2009-11-03: 7 - Fixed: Do not crash on outdated temporary files 8 - Fixed: Do not crash on unavailable machines 5 9 6 10 Version 2.0 beta3 2009-10-29: -
branches/guitools-2.0/evfsgui/evfsgui.VRP
r345 r346 8 8 VRXWindow: __VREMainWindow,1,1072,1783,891,3951 9 9 VRXWindow: __VRESectionListWindow,1,602,11708,11033,3342 10 VRXWindow: __VREToolsWindow,1,1963,819,69 86,166110 VRXWindow: __VREToolsWindow,1,1963,819,6992,1665 11 11 UserFile: 1 12 12 UserWindow: Main,1 -
branches/guitools-2.0/shared/smbtree.vrs
r345 r346 87 87 smbtree.!machine = VRMethod( "CN_smbtree", "AddRecord",parent,, machine||'0D0A'x||comment) 88 88 /* We make any machine as sleeping initially */ 89 ok = VRMethod( 'CN_smbtree', 'SetRecordAttr', smbtree.!machine, 'Icon',"#61:PMWP.DLL")89 ok = VRMethod( "CN_smbtree", "SetRecordAttr", smbtree.!machine, "Icon","#61:PMWP.DLL") 90 90 ok = VRMethod( "CN_smbtree", "SetRecordAttr", smbtree.!machine, "ReadOnly", 1) 91 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, NBFH, machine, CommentFH, Comment, WorkGroupFH, CurWG)91 ok = VRMethod( "CN_smbtree", "SetFieldData", smbtree.!machine, NBFH, machine, CommentFH, Comment, WorkGroupFH, CurWG) 92 92 ok = VRSet( "CN_smbtree", "Painting", 0 ) 93 93 if VRGet("CN_smbtree","View") = "Detail" then do … … 170 170 say "_RefreshShares() started" 171 171 RefreshID = RANDOM() 172 smb shares = TempDir||"smbshares."||machine173 174 say 'detach 'samba.!smbclientexe' -L "'strip(machine)'" 'UserCred' 'debuglevel' 1>'smb shares' 2>NUL'175 address cmd 'detach 'samba.!smbclientexe' -L "'strip(machine)'" 'UserCred' 'debuglevel' 1>'smb shares' 2>NUL'172 smbmachine = TempDir||"smbmachine."||machine 173 174 say 'detach 'samba.!smbclientexe' -L "'strip(machine)'" 'UserCred' 'debuglevel' 1>'smbmachine' 2>NUL' 175 address cmd 'detach 'samba.!smbclientexe' -L "'strip(machine)'" 'UserCred' 'debuglevel' 1>'smbmachine' 2>NUL' 176 176 177 177 RefreshMode = "SHARE" … … 186 186 say "_AddSharesDisplay() started" 187 187 188 ok = SysFileTree(Tempdir||'smbshares.*',smbshare.,'FO') 189 190 if smbshare.0 = 0 then do /* we are done, no more files around, cleanup, disable Timer and exit */ 188 ok = SysFileTree(Tempdir||'smbmachine.*',smbmachine.,'FO') 189 say ' 'smbmachine.0' file(s) to process.' 190 191 if smbmachine.0 = 0 then do /* we are done, no more files around, cleanup, disable Timer and exit */ 191 192 RefreshMode = "" 192 193 ok = VRSet("CN_smbtree","Enabled", 1) … … 202 203 if ShowHidden = 'SHOWHIDDEN' | ShowHidden = '' then ShowHidden = 0 203 204 204 do I = 1 to smbshare.0 205 stat = stream(smbshare.I,'c','open read') 205 do I = 1 to smbmachine.0 206 say ' Going for "'smbmachine.I'"' 207 stat = stream(smbmachine.I,'c','open read') 206 208 if stat = "READY:" then do /* we found a readable output file */ 207 Machine = VRParseFilename(smb share.I,'E')209 Machine = VRParseFilename(smbmachine.I,'E') 208 210 smbtree.!machine = _GetMachinehandle(Machine) 209 210 line = linein(smbshare.I) 211 say line 211 say ' Machine (handle) = "'machine'" ('smbtree.!machine')' 212 213 if smbtree.!machine = "" then do /* invalid (old) file */ 214 say "_AddSharesDisplay() exit with Invalid file found (no corresponding machine)" 215 ok = stream(smbmachine.I,'c','close') 216 ok = SysFileDelete(smbmachine.I) 217 iterate 218 end 219 line = linein(smbmachine.I) 220 say ' Answer "'line'"' 212 221 ok = VRMethod('CN_smbtree', 'SetRecordAttr', smbtree.!machine, 'UserData', "SERVER|"||strip(line)) 213 222 214 if left(line, 20) = "session setup failed" then do /* we see an error message */ 215 say left(line, 20) 216 signal sharecleanup 223 if pos("FAIL", translate(line)) > 0 then do /* we see an error message - the term "FAIL" seems to be common to all */ 224 say '_AddSharesDisplay() exit with "'line'"' 225 ok = stream(smbmachine.I,'c','close') 226 ok = SysFileDelete(smbmachine.I) 227 iterate 217 228 end 218 229 219 230 retries = 0 220 231 do while(left(line,1) <> '09'x) 221 line = linein(smb share.I)232 line = linein(smbmachine.I) 222 233 retries = retries + 1 223 say ' Retry 'retries234 say ' Skip 'retries' "'line'"' 224 235 if retries >=10 then do /* No valid output - error */ 225 signal sharecleanup 226 end 227 end 236 say "_AddSharesDisplay() exit with invalid output error" 237 ok = stream(smbmachine.I,'c','close') 238 ok = SysFileDelete(smbmachine.I) 239 leave 240 end 241 end 242 if retries >=10 then iterate 228 243 229 244 /* Skip header */ 230 line = linein(smb share.I)231 line = linein(smb share.I)245 line = linein(smbmachine.I) 246 line = linein(smbmachine.I) 232 247 233 248 if left(line,5) = "Error" then ok = VRMethod('CN_smbtree', 'SetRecordAttr', smbtree.!machine, 'UserData', "SERVER|"||strip(line)) … … 254 269 255 270 /* get next share */ 256 line = linein(smb share.I)257 end 258 sharecleanup: 259 say "_AddSharesDisplay() cleanup"260 ok = stream(smb share.I,'c','close')261 ok = SysFileDelete(smb share.I)262 if ok <> 0 then say 'Failure 'ok' deleting "'smb share.I'"!'271 line = linein(smbmachine.I) 272 end 273 274 say "_AddSharesDisplay() success and cleanup" 275 ok = stream(smbmachine.I,'c','close') 276 ok = SysFileDelete(smbmachine.I) 277 if ok <> 0 then say 'Failure 'ok' deleting "'smbmachine.I'"!' 263 278 end 279 else say ' Got "'stat'" for "'smbmachine.I'"' 264 280 end 265 281 say "_AddSharesDisplay() loop finished" … … 270 286 271 287 _GetMachinehandle: procedure 272 Machine = arg(1) 288 Machine = translate(arg(1)) 289 273 290 ok = VRMethod("CN_smbtree", "GetRecordList", "All", rh.) 291 match = 0 274 292 275 293 do I = 1 to rh.0 276 277 ResName = VRMethod("CN_smbtree","GetRecordAttr",rh.I,"Caption") 294 ResName = translate(VRMethod("CN_smbtree","GetRecordAttr",rh.I,"Caption")) 278 295 279 296 parse var ResName ResName '0D0A'x . 280 297 ResName = strip(ResName) 281 298 282 if Machine = ResName then leave /* we got a matching name */ 283 end 299 if Machine = ResName then do /* we got a matching name */ 300 match = 1 301 leave 302 end 303 end 304 if match = 0 then rh.I = "" /* return an empty handle, if there was no match */ 284 305 return rh.I
Note:
See TracChangeset
for help on using the changeset viewer.