|
-
Nov 6th, 2006, 01:21 PM
#1
Thread Starter
Hyperactive Member
File Check/Atributes
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
-
Nov 6th, 2006, 01:34 PM
#2
Re: File Check/Atributes
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
-
Nov 6th, 2006, 01:56 PM
#3
Thread Starter
Hyperactive Member
Re: File Check/Atributes
cool thanks, makes sense. il give it a throw.
-
Nov 6th, 2006, 02:13 PM
#4
Re: File Check/Atributes
I would suggest loading them into a listview. It will make things much cleaner and easier to read.
-
Nov 6th, 2006, 02:16 PM
#5
Re: File Check/Atributes
 Originally Posted by Hack
I would suggest loading them into a listview. It will make things much cleaner and easier to read.
Me too 
Pradeep
-
Nov 6th, 2006, 02:28 PM
#6
Thread Starter
Hyperactive Member
Re: File Check/Atributes
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.
-
Nov 6th, 2006, 02:31 PM
#7
Thread Starter
Hyperactive Member
Re: File Check/Atributes
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?
Last edited by MeTTa@; Nov 6th, 2006 at 02:35 PM.
-
Nov 6th, 2006, 02:54 PM
#8
Re: File Check/Atributes
 Originally Posted by MeTTa@
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.
Are you building your own Windows Explorer?
-
Nov 6th, 2006, 03:05 PM
#9
Thread Starter
Hyperactive Member
Re: File Check/Atributes
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.
-
Nov 6th, 2006, 03:07 PM
#10
Re: File Check/Atributes
the trick is to use pre-written code.
there are many excellent API file recursions at VBnet
-
Nov 6th, 2006, 03:59 PM
#11
Thread Starter
Hyperactive Member
Last edited by MeTTa@; Nov 6th, 2006 at 05:21 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|