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


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

Re: A strange behaviour of a File property

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@ieee-dot-org.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: A strange behaviour of a File property
Date Sat, 12 Nov 2011 09:15:16 -0500
Organization A noiseless patient Spider
Lines 68
Message-ID <j9lv1n$m2k$1@dont-email.me> (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> <j9ltdf$mma$1@news.newsland.it>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Sat, 12 Nov 2011 14:15:19 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="HSlJAUb3pGXi3i7ZL/HoAw"; logging-data="22612"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9/Vdj+0h1fTdQGauqV4OP"
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:8.0) Gecko/20111105 Thunderbird/8.0
In-Reply-To <j9ltdf$mma$1@news.newsland.it>
Cancel-Lock sha1:4Y+sCAj7gENI13NHCLHONOiQrZw=
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9876

Show key headers only | View raw


On 11/12/2011 9:04 AM, Alexo wrote:
>[...]
> The correct behaviour of the program is obtained only if I use "."

	import java.io.File;
	public class Alexo {
	    public static void main(String[] unused) {
	        tryit(".");
	        tryit("\\");
	    }
	    private static void tryit(String start) {
	        System.out.println("Starting String:\t" + start);
	        File begin = new File(start);
	        System.out.println("Starting File:\t" + begin);
	        for (File child : begin.listFiles()) {
	            char file = child.isFile() ? 'Y' : 'N';
	            char dir = child.isDirectory() ? 'Y' : 'N';
	            System.out.println("File? " + file + ", Dir? " + dir
	                    + "\t" + child);
	        }
	        System.out.println();
	    }
	}

Starting String:        .
Starting File:        .
File? N, Dir? Y        .\build
File? Y, Dir? N        .\build.xml
File? N, Dir? Y        .\coverage
File? Y, Dir? N        .\manifest.mf
File? N, Dir? Y        .\nbproject
File? N, Dir? Y        .\src
File? N, Dir? Y        .\test

Starting String:        \
Starting File:        \
File? Y, Dir? N        \AUTOEXEC.BAT
File? Y, Dir? N        \boot.ini
File? Y, Dir? N        \BOOTSECT.DOS
File? N, Dir? Y        \Config.Msi
File? Y, Dir? N        \CONFIG.SYS
File? N, Dir? Y        \djgpp
File? N, Dir? Y        \Documents and Settings
File? N, Dir? Y        \DRIVERS
File? N, Dir? Y        \I386
File? Y, Dir? N        \INSTALL.LOG
File? Y, Dir? N        \IO.SYS
File? Y, Dir? N        \IPH.PH
File? N, Dir? Y        \Media
File? Y, Dir? N        \MSDOS.SYS
File? N, Dir? Y        \My Music
File? Y, Dir? N        \net_save.dna
File? Y, Dir? N        \NTDETECT.COM
File? Y, Dir? N        \ntldr
File? N, Dir? Y        \NVIDIA
File? Y, Dir? N        \pagefile.sys
File? N, Dir? Y        \Program Files
File? N, Dir? Y        \RECYCLER
File? N, Dir? Y        \System Volume Information
File? N, Dir? Y        \TEMP
File? Y, Dir? N        \uninstall.log
File? N, Dir? Y        \WINDOWS
File? N, Dir? Y        \WINNT
File? N, Dir? Y        \WUTemp

-- 
Eric Sosman
esosman@ieee-dot-org.invalid

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