How to long into string array

Hi All,

is there any possibility to convert long into string array using the followuing code:

File sampleFiles =new File("C:/Example/convert");

long folder=sampleFiles.length();

String[] folderList= ?

[325 byte] By [sebas.navina] at [2007-11-27 10:52:15]
# 1

Voodoo?

What are you really trying to achieve? This is a guess at a solution to something, what is that something?

georgemca at 2007-7-29 11:36:24 > top of Java-index,Java Essentials,Java Programming...
# 2

String[] folderList= {"Read the API for File"};

BigDaddyLoveHandlesa at 2007-7-29 11:36:24 > top of Java-index,Java Essentials,Java Programming...
# 3

Hi,

I want to convert this length of the files in that path into a string array.

sebas.navina at 2007-7-29 11:36:24 > top of Java-index,Java Essentials,Java Programming...
# 4

> Hi,

> I want to convert this length of the files in

> that path into a string array.

Suppose the length was 17. What would the String array be?

BigDaddyLoveHandlesa at 2007-7-29 11:36:24 > top of Java-index,Java Essentials,Java Programming...
# 5

Hi,

It Must come in bytes for example,

size ofc:/Example/convert/Example.txt =2420 bytes;

c:/Example/convert/Example1.txt =2423 bytes;

when i give sampleFiles.length it displays as

sampleFile[0].length=2420 bytes;

sampleFile[1].length=2423 bytes;

can we put this sampleFile.length in String[] folderSize.

sebas.navina at 2007-7-29 11:36:24 > top of Java-index,Java Essentials,Java Programming...
# 6

So sampleFiles is a *directory* and you want information about the files in that directory? Again, read the File API. You'll find out some interesting things like sampleFiles.length() is not what you think it is.

http://java.sun.com/javase/6/docs/api/

BigDaddyLoveHandlesa at 2007-7-29 11:36:24 > top of Java-index,Java Essentials,Java Programming...
# 7

Do you want the size of the file or the lenght of characters in the file? Be a little clear on this.

Uppalapatia at 2007-7-29 11:36:24 > top of Java-index,Java Essentials,Java Programming...