Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

AVR DOS KILL

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS
View previous topic :: View next topic  
Author Message
njepsen

Bascom Member



Joined: 13 Aug 2007
Posts: 469

newzealand.gif
PostPosted: Fri Feb 22, 2019 3:40 am    Post subject: AVR DOS KILL Reply with quote

I am having trouble with the KILL command. I am logging data to an SD card., and from time to time ( and I dont know how) I end up with a file that is zero bytes long.
eg xxxxxxxx.TXT I detect these files and try to kill them thus:
( as the code is very long, only the relevant bits are shown)



Code:


       '*******************************************************************************
   $regfile = "m1284pdef.dat"                                  'my processor
   $crystal = 9830400                                          'system crystal
   $framesize = 800                                            ' Located at top of 16k of SRAM
   $hwstack = 550                                              '
   $swstack = 550                                              '
   $frameprotect = 1
   stop watchdog


      If Msg_id = 0 Then                                  
         Print #1 , ">> deleting " ; Myfilename
         Chdir "\"
         Chdir Cachefoldernamestr
         Kill Myfilename                                    'delete from sd card
                 
      End If


The code works fine, and has been for several years, except when a zero file arrives, then the code hangs, immediately at "kill myfilename"
I have got round the issue but my question is - does kill not work with a zero length file?

_________________
Neil
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5915
Location: Holland

blank.gif
PostPosted: Fri Feb 22, 2019 9:43 pm    Post subject: Reply with quote

you should log the Gbdoserror value.
It should be 0.

Do you know about the SIMULATE AVR DOS.bas sample in the avr-dos folder?
It is a great way to test things without hardware.

I tried this :

Code:
Print "Kill test"
Open "testx.bin" For Binary As #11
Flush #11
Close #11
Kill "testx.bin"
 


and i got gbDOSerror 0
So it seems to work ok.
you best log this error in your code when it is non zero in order to have a clue.

you should also make some tests like the one i did to see if it is reproducible with a small program.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum