Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Searching for compare directories utility
Message
From
30/11/2001 03:14:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00582535
Message ID:
00587866
Views:
36
This message has been marked as a message which has helped to the initial question of the thread.
>In DOS we had Norton Commander, I had Windows Commander, but I don't have it here...

FYI NC DOS still works. Also there are far, wincommander etc. I think still windiff is better. NC was doing it based on filename,size and datetime not the content also.
If NC style would work for you :
Gettree(getdir(),.t.)
browse

Function Gettree
Lparameters tcDirectory, tlFiles
Create cursor crsFiles ;
  (FolderId i, Filename m, FileSize i, Created t, Modified t, Accessed t)
Create cursor crsFolders (Folder m, FolderId i)

oFS = CREATEOBJECT('Scripting.FileSystemObject')
oFolder = oFS.GetFolder(tcDirectory)
Insert into crsFolders ;
  (Folder , FolderId ) ;
  values ;
  (oFolder.Path, reccount('crsFolders')+1)
If tlFiles
   GetFiles(oFolder, reccount('crsFolders'))
Endif
  
tcDirectory = iif(oFolder.IsRootFolder(), substr(tcDirectory,1,len(tcDirectory)-1), tcDirectory)
=_SubFolders(oFolder, tcDirectory, tcDirectory,tlFiles)
select crsFiles
index on FolderId tag FolderID
local array arrFolderSize[1], arrFileNameSize[1]
local lnFolderSize, lnFileNameSize

select max(len(Folder)) from crsFolders into array arrFolderSize
select max(len(Filename)) from crsFiles into array arrFileNameSize
lnFolderSize = min(254,arrFolderSize)
lnFileNameSize = min(254, arrFileNameSize)

select padr(Folder,lnFolderSize), padr(Filename,lnFileNameSize) , ;
	FileSize , Created , Modified , Accessed ;
	from crsFolders join crsFiles on crsFolders.FolderId = crsFiles.FolderId ;
	into cursor crsResult

Function _SubFolders
Lparameters toFolder, tcPath, tcStartPath, tlFiles
Local loSubFolders
tcPath = tcStartPath
For each oSubFolder in toFolder.Subfolders
  If oSubFolder.Name # "System Volume Information"
    Insert into crsFolders ;
      (Folder , FolderId ) ;
      values ;
      (oSubFolder.Path, reccount('crsFolders')+1)
    If tlFiles
      GetFiles(oSubFolder, reccount('crsFolders'))
    Endif
    =_SubFolders(oSubFolder, tcPath, tcPath+"\"+ oSubFolder.name, tlFiles)
  Endif
Endfor

Function GetFiles
Lparameters toFolder, tnId
For each oFile in toFolder.Files
  Insert into crsFiles ;
    (FolderId, Filename, FileSize, Modified, Accessed , Created ) ;
    values ;
    (tnId, oFile.Name, oFile.Size, ;
    oFile.DateCreated, oFile.DateLastModified, oFile.DateLastAccessed)
Endfor
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform