Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #9875

Re: A strange behaviour of a File property

From alelvb@inwind.it (Alexo)
Newsgroups comp.lang.java.programmer
Subject Re: A strange behaviour of a File property
Date 2011-11-12 15:04 +0100
Organization http://www.newsland.it/
Message-ID <j9ltdf$mma$1@news.newsland.it> (permalink)
References <5980efbc-9010-4145-b886-fe106c5ac2d5@c18g2000yqj.googlegroups.com><2735801.801.1321025690138.JavaMail.geo-discussion-forums@prdy11> <dd0a52bf-1eae-4cd5-965f-ffa91582b4ab@w3g2000vbw.googlegroups.com> <13969500.491.1321049846293.JavaMail.geo-discussion-forums@prou19>

Show all headers | View raw


> Sorry, can't help you with such little data.

the purpose of the program is to list the content of a directory and to
show if a file is a directory using isDirectory().
When I execute the code with the dot "." directory, the output of the code
is:

classpath	is a directory?: false
project	is a directory?: false
settings	is a directory?: true
Main.class	is a directory?: false
Main.java	is a directory?: false

the behaviour of the program is correct and it shows that the file
settings is in reality a directory. When I try to change path utilising
for example "/", the root directory of the disk, the output is:

AUTOEXEC.BAT	is a directory?: false
boot.ini	is a directory?: false
Bootfont.bin	is a directory?: false
CONFIG.SYS	is a directory?: false
Documents and Settings	is a directory?: false
EasyShareInstall.log	is a directory?: false
Intel	is a directory?: false
IO.SYS	is a directory?: false
MSDOS.SYS	is a directory?: false
NTDETECT.COM	is a directory?: false
ntldr	is a directory?: false
pagefile.sys	is a directory?: false
Program Files	is a directory?: false
Programmi	is a directory?: false
RECYCLER	is a directory?: false
System Volume Information	is a directory?: false
VritualRoot	is a directory?: false
WINDOWS	is a directory?: false

this output shows the problem I have spotted:
here infact any file is treated like a file i.e. not a directory while 

Documents and Setting 
Intel
Program Files
Programmi
WINDOWS

are directories. The result is similar with any other path (either
absolute like "/Documents and Settings/program Files" or relative like
"../../".
The correct behaviour of the program is obtained only if I use "."

my OS is Windows XP
and I compiled the code with Eclipse IDE


-- 

questo articolo e` stato inviato via web dal servizio gratuito 
http://www.newsland.it/news segnala gli abusi ad abuse@newsland.it

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

A strange behaviour of a File property alelvb@inwind.it - 2011-11-11 05:45 -0800
  Re: A strange behaviour of a File property Lew <lewbloch@gmail.com> - 2011-11-11 07:34 -0800
    Re: A strange behaviour of a File property alelvb@inwind.it - 2011-11-11 09:28 -0800
      Re: A strange behaviour of a File property Lew <lewbloch@gmail.com> - 2011-11-11 14:17 -0800
        Re: A strange behaviour of a File property alelvb@inwind.it (Alexo) - 2011-11-12 15:04 +0100
          Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-12 09:15 -0500
            Re: A strange behaviour of a File property alelvb@inwind.it (Alexo) - 2011-11-12 16:17 +0100
              Re: A strange behaviour of a File property Zlatko Đurić <zladuric@gmail.com> - 2011-11-12 16:09 +0100
              Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-12 10:13 -0500
  Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-11 16:25 +0000
    Re: A strange behaviour of a File property alelvb@inwind.it - 2011-11-11 09:42 -0800
      Re: A strange behaviour of a File property Arne Vajhøj <arne@vajhoej.dk> - 2011-11-11 13:24 -0500
    Re: A strange behaviour of a File property Lew <lewbloch@gmail.com> - 2011-11-11 14:13 -0800
    Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-11 20:38 -0500
      Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-12 03:21 +0000
        Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-12 08:26 -0500
          Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-12 22:09 +0000
            Re: A strange behaviour of a File property Arne Vajhøj <arne@vajhoej.dk> - 2011-11-12 17:40 -0500
              Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-13 01:28 +0000
                Re: A strange behaviour of a File property Arne Vajhøj <arne@vajhoej.dk> - 2011-11-12 20:42 -0500
                Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-13 12:15 +0000
                Re: A strange behaviour of a File property Martin Gregorie <martin@address-in-sig.invalid> - 2011-11-13 12:42 +0000
                Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-13 13:06 +0000
        Re: A strange behaviour of a File property Arne Vajhøj <arne@vajhoej.dk> - 2011-11-12 17:25 -0500
          Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-13 01:15 +0000
            Re: A strange behaviour of a File property Arne Vajhøj <arne@vajhoej.dk> - 2011-11-12 20:40 -0500
              Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-13 12:42 +0000
            Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-12 21:11 -0500
              Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-13 20:50 +0000
                Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-14 08:18 -0500
                Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-14 17:38 +0000
                Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-14 21:51 -0500
                Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-15 14:17 +0000
                Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-15 22:20 -0500
                Re: A strange behaviour of a File property Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2011-11-16 12:14 +0000
                Re: A strange behaviour of a File property Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-11-16 08:10 -0500
      Re: A strange behaviour of a File property Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2011-11-11 19:46 -0800
      Re: A strange behaviour of a File property Owen Jacobson <angrybaldguy@gmail.com> - 2011-11-14 00:24 -0500
        Re: A strange behaviour of a File property Lew <lewbloch@gmail.com> - 2011-11-13 22:00 -0800
  Re: A strange behaviour of a File property Roedy Green <see_website@mindprod.com.invalid> - 2011-11-12 05:00 -0800
    Re: A strange behaviour of a File property Arne Vajhøj <arne@vajhoej.dk> - 2011-11-12 09:15 -0500

csiph-web