But after that trap, if I do a new '/file/getall', the second file I tried to delete has the exact same .id, and if I now attempt to remove it with '/file/remove' (again by .id), it succeeds.
I thought the entire point of using .id in the API was that the IDs are globally unique to the device and do not change, so one is safe to refer to the object in question by ID with API commands.
My question: Why on earth must I re-execute '/file/getall' after each file deletion just to avoid file removal failure?
In the API session output below, note that the device has two files, "foobar5.html" and "foobar3.html" that I wish to delete. Note also that the .id attributes of each file NEVER change over the course of the API session. Note finally that of the two exactly identical "/file/remove" commands attempting to remove file "foobar5.html" (with ID *1F010320), the first fails, but the second succeeds.
Why is that? (Why does one command fail, but the subsequent one succeeds when they are identical in every way?)
Here's my API session in question:
Code: Select all
Command (/quit to end): /file/getall
=== COMMAND: /file/getall
<<< '/file/getall' (12)
<<< '.tag=15' (7)
<<< END-OF-SENTENCE
>>> '!re' (3)
>>> '.id=*1F010320' (13)
>>> 'name=foobar5.html' (17)
>>> 'type=.html file' (15)
>>> 'size=440' (8)
>>> 'creation-time=jan/15/2010 15:20:47' (34)
>>> 'contents=<?xml version="1.0" encoding="utf-8"?>' (47)
>>> '.tag=15' (7)
>>> END-OF SENTENCE
>>> '!re' (3)
>>> '.id=*1F010416' (13)
>>> 'name=foobar3.html' (17)
>>> 'type=.html file' (15)
>>> 'size=440' (8)
>>> 'creation-time=jan/15/2010 15:18:57' (34)
>>> 'contents=<?xml version="1.0" encoding="utf-8"?>' (47)
>>> '.tag=15' (7)
>>> END-OF SENTENCE
>>> '!done' (5)
>>> '.tag=15' (7)
>>> END-OF SENTENCE
Next I try deleting the second of the two, "foobar3.html" using the file's object ID *1F010416:
Code: Select all
Command (/quit to end): /file/remove =.id=*1F010416
=== COMMAND: /file/remove
<<< '/file/remove' (12)
<<< '=.id=*1F010416' (14)
<<< '.tag=16' (7)
<<< END-OF-SENTENCE
>>> '!done' (5)
>>> '.tag=16' (7)
>>> END-OF SENTENCE
Code: Select all
Command (/quit to end): /file/remove =.id=*1F010320
=== COMMAND: /file/remove
<<< '/file/remove' (12)
<<< '=.id=*1F010320' (14)
<<< '.tag=17' (7)
<<< END-OF-SENTENCE
>>> '!trap' (5)
>>> 'category=4' (10)
>>> 'message=no such item (4)' (24)
>>> '.tag=17' (7)
>>> END-OF SENTENCE
=== TRAP: 'no such item (4)'
>>> '!done' (5)
>>> '.tag=17' (7)
>>> END-OF SENTENCE
Code: Select all
Command (/quit to end): /file/getall
=== COMMAND: /file/getall
<<< '/file/getall' (12)
<<< '.tag=18' (7)
<<< END-OF-SENTENCE
>>> '!re' (3)
>>> '.id=*1F010320' (13)
>>> 'name=foobar5.html' (17)
>>> 'type=.html file' (15)
>>> 'size=440' (8)
>>> 'creation-time=jan/15/2010 15:20:47' (34)
>>> 'contents=<?xml version="1.0" encoding="utf-8"?>' (47)
>>> '.tag=18' (7)
>>> END-OF SENTENCE
>>> '!done' (5)
>>> '.tag=18' (7)
>>> END-OF SENTENCE
Code: Select all
Command (/quit to end): /file/remove =.id=*1F010320
=== COMMAND: /file/remove
<<< '/file/remove' (12)
<<< '=.id=*1F010320' (14)
<<< '.tag=19' (7)
<<< END-OF-SENTENCE
>>> '!done' (5)
>>> '.tag=19' (7)
>>> END-OF SENTENCE
Thanks in advance for any ideas!
Aaron out.