|
-
Jul 22nd, 2003, 10:03 AM
#1
Thread Starter
Junior Member
Determine # of files inside a directory
Dear CornedBee.
Thanks for ur help. but is there a way for the system to determine the path on its own without specifying the path, eg.
c:\\java\project ?????
Tq,
Neptune.
-
Jul 23rd, 2003, 01:20 AM
#2
Huh?
Which path do you want?
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 23rd, 2003, 01:36 AM
#3
Thread Starter
Junior Member
let me explain more detail. that day u give me a solution to determine # files in a directory.
here it is:
java.io.File dir = new java.io.File("c:\\java\project");
int count = dir.list().length;
"c:\\java\project" is the pathname right?
so, is there anyway for the system to know the path without us typing this-->"c:\\java\project" by the time the above 2 codes is being executed?
hope u can read me.
Sincerely;
Nepunel.
-
Jul 23rd, 2003, 04:10 AM
#4
Which path name? I think there is a File.getCwd or something to get the current directory, which may or may not be what you want.
However, in this sentence
"for the system to know the path "
"the path" refers to nothing. Sorry, semantic error, I can't compile your sentence to brain code
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 23rd, 2003, 04:22 AM
#5
Thread Starter
Junior Member
Haha. i m so sorry.
i think the File.getCwd is wat i want. i just want to know the current directory in a drive.
Let say computer A and B.
inside A, user compile and run its java file inside c:\\java\project
meanwhile inside B. another user run its java file inside d:\\assignment
so, this 2 directory is totally different right? therefore, it'll be meaningless to specify the pathname like c:\\java\project inside my pc(let say C) as it gives no meaning for computer B?
hope u understand as i also
Neptune.
-
Jul 23rd, 2003, 04:23 AM
#6
Thread Starter
Junior Member
if possible, can i hav ur contact like icq#?
-
Jul 23rd, 2003, 08:47 AM
#7
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
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
|