Say i have a directory of files, i want to make a list (in text) of
A: file name
B: Date Modified
C: file size
for all the files.
I want to check the whole directory, anyone know anything i could start off with? Thanks,
___
Dan
Printable View
Say i have a directory of files, i want to make a list (in text) of
A: file name
B: Date Modified
C: file size
for all the files.
I want to check the whole directory, anyone know anything i could start off with? Thanks,
___
Dan
This would do. (Replace the debug.prints with your variables)
VB Code:
Private Sub Command1_Click() mydir = "c:\temp" file = Dir(mydir & "\*.*") Do While file <> "" file = mydir & "\" & file Debug.Print file Debug.Print FileDateTime(file) Debug.Print FileLen(file) & " bytes" file = Dir Loop End Sub
Pradeep :)
cool thanks, makes sense. il give it a throw.
I would suggest loading them into a listview. It will make things much cleaner and easier to read.
Me too ;)Quote:
Originally Posted by Hack
Pradeep
lol, great minds think alike, im doing that right now. :/ Im a little slow tho, if ya want help me out, if not kool, i get it at my pace.
nevermind, easy. (sorry for the spammin, il edit now)
EDIT: Ok, it lists files, what about sub directories/files, i think it would get complex, but is there any tricks?
There are no tricks...it does get complex. Basically you are talking about a recursive tree walk.Quote:
Originally Posted by MeTTa@
Are you building your own Windows Explorer?
lol no, im making a program that compares 2 directories, 1 local, and 1 on a server. If any local changes are made, the files that are changed get uploaded.
the trick is to use pre-written code.
there are many excellent API file recursions at VBnet
Ok, good suggestion.