Pages: [1]
  Print  
Author Topic: A question of DIR calling  (Read 3045 times)
0 Members and 1 Guest are viewing this topic.
nanifrankey
Newbie
*
Posts: 25


« on: 22 May , 2009, 04:54:46 »

In the example, it shows that
loadVariables("http://127.0.0.1:1001/Basic/file?klCommand=dir&klPath=\\&klArgs=/s", "/main", "POST");
it works, when I trace klDirCount, it shows following;
1&klFile86=resourcehelps6030.hlp&klFile87=resourcehelp pn.h01&klFile88=resourceerrrd&klFile89=systemdatacacerts.dat&klFile90=systemdataDcfRepDb&klFile91=systemdatalocalmode.ini&klFile92=systemdata   estexecute.ini&klFile93=systemshareddata@059cd.ini&klFile94=systemSystem.ini&klFile95=testframework   estframework.ini&klFile96=ethernetced.xml&klFile97=klEmuId.txt&klFile98=klEmuInstall.txt&klFile99=klEmuPort.txt&klFile100=KLEmuText.txt&klFile101=klRequest.txt&klFile102=klResponse.txt&klFile103=sample1.wav&klFileCount=103&klEnd=1&

it seems only part of the file in the directory are shown here. How can I see whole files?
second question is:
When I change the path to my target, see below. It cannot trace any files in the folder any more. Did I make anything wrong?
How can I look through the file in my target folder?
loadVariables("http://127.0.0.1:1001/Basic/file?klCommand=dir&klPath=\\Data\\Images&klArgs=/s", "/main", "POST");
« Last Edit: 22 May , 2009, 05:06:36 by nanifrankey » Logged
nanifrankey
Newbie
*
Posts: 25


« Reply #1 on: 22 May , 2009, 06:07:58 »

Even when I trace
                     trace(klDirCount)
there is nothing!~
Please help me. Thank you beforehand.
« Last Edit: 22 May , 2009, 06:21:51 by nanifrankey » Logged
nanifrankey
Newbie
*
Posts: 25


« Reply #2 on: 22 May , 2009, 06:58:28 »

it is very weird. Everytime,only when I restart amulator, the klFileCount may have value, otherwise it is null
What is the problem?
Could you help me to look at it?
Logged
KL Admin
Moderator
Sr. Member
*****
Posts: 313


« Reply #3 on: 26 May , 2009, 10:51:05 »

Hello,

as mentioned in the wiki, if you use /s kldirCount is never returned. It lists only files frm subfolders then.

Also master path is not returned. It only returns the path names relative to given subfolder, otherwise the returned data size would bloat ten times bigger. Think about the use case when returning paths of hundreds of files from root.

I hope that helped Wink
Logged
nanifrankey
Newbie
*
Posts: 25


« Reply #4 on: 27 May , 2009, 02:42:19 »

It reasonable, if it returns all files, horrible.
However, I just want to list all names in Images for example.
I am sure, that there are only few pictures in this folder, I want to see files names, but now I can only count how many files there are, if I want to list the names of files , I need to use trace(klFile[]) right?

I try to trace these 2 value as following,
trace("number of files" add klFileCount);
trace("file names" add klFile); 
     
klFileCount works. klFile doesn't work, it cannot return any file names. 

output: number of files8, file names.
no file name is listed.
How to use it? Tongue
Very appreciate it!!

PS: it is quite easy to understand of the wiki, but it doesn't work, when I delete /s. It returns neither the number of folders nor name of folders.
klDirCount    
klDir[1..X]
how to trace klDir? trace(klDir[1..klDirCount])? I would like to list all folders name, trace(klDirCount) is that ok?
It is the samiler problem as klFile[1..X]
Logged
Pages: [1]
  Print  
 
Jump to: