FIND and GET not using the same values (Bug?)

Hi all,

I’m using 2.9.34 and trying to configure a simple script. The script will be used in scheduler and will simply look for any .RSC files in flash and /import them.

When trying it out, I came across a wierd problem. First of all, here is my “/file print” output

[andrea@Home230] file> print
 # NAME                   TYPE                  SIZE       CREATION-TIME       
 0 hotspot/img            directory                        nov/01/2006 11:54:05
 1 hotspot/img/logobot... .png file             4317       nov/01/2006 11:54:05
 2 address1.rsc           script                11710      jan/05/2007 03:48:58
 3 hotspot                directory                        nov/01/2006 11:54:05
 4 hotspot/lv             directory                        nov/01/2006 11:54:05

As you can see, the file ‘address1.rsc’ is the only script file in storage and has an index of 2, but look what happens when I do a ‘find type=script’…

[andrea@Home230] file> :put [find type=script]
*3011853

I get an index ID of 3011853. In theory if I do a ‘get 3011853 name’, I should get the full name of the file (‘address1.rsc’), but instead

[andrea@Home230] file> :put [get 3011853 name]       
item number too large

If I do a ‘get 2 name’ (remember that ‘2’ is the actual index ID as returned by the first PRINT command), the result is correct

[andrea@Home230] file> :put [get 2 name]       
address1.rsc

Am I missing something??

Try to add “*” before number.

:put [get *3011853 name]

It does not work in all the cases though. Sometimes you need to enter command like you did, and then again with “*”, to get correct name.
It shouldn’t be that way.

[admin@...] > file print 
 # NAME                   TYPE                  SIZE       CREATION-TIME  
...
24 exp.rsc                script                13318      jan/03/2000 18:32:24
25 test.rsc               script                52         jan/03/2000 23:14:05

[admin@...] > :put [/file find type=script]  
*1F010D1D,*1F010E7E
[admin@...] > :put [/file get *1F010E7E name]

[admin@...] > :put [/file get 1F010E7E name] 
invalid item number
[admin@...] > :put [/file get *1F010E7E name]
test.rsc
[admin@...] >

I tried putting in the * before the number and it worked fine. I also tried putting 2 files in storage and use a :foreach loop to execute each one of them, this works as well.

Therefore it’s not a bug, it just uses different numbers, not the ones listed in Print.

Thanks for your help

I found out that it is not a bug. It is supposed to be so. Number returned by “find” command is not the same that you see when you are doing print command.