View previous topic :: View next topic |
Author |
Message |
Jerry
Joined: 25 May 2004 Posts: 40 Location: New York
|
Posted: Thu Feb 13, 2014 8:42 pm Post subject: Name "oldname" As "newname" |
|
|
Hello AVR-DOS users,
I have a couple of questions.
1. I have seen in this forum the method of renaming a file by using Name "old" as "new".
Where is this function referenced and how would I ever know it exists without seeing it in this forum? I searched Bascom help. I searched all documentation I received with AVR-DOS.
I see no reference to "NAME" anywhere. If it is documented and I missed it, I apologize please tell me where it is located. It makes me wonder what else is not documented or very well hidden that may be useful when using AVR-DOS.
2. Let's say I would like to keep a file size limit to 1000 bytes and after writing or appending to the file I see the file size is larger than my limit size.
Is there a simple way to open that file and write EOF marker at a particular location in the file? Or maybe there is a way to delete data in the file from a certain point all the way to the end of the file?
I know I could read byte by byte and write to a new file byte by byte while counting the bites until I reach the byte limit then close the new file, delete the old file, then rename the new file to the old file. It seems like there should be a better solution.
Any help would be greatly appreciated.
Thanks,
Jerry |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Feb 13, 2014 9:06 pm Post subject: |
|
|
1 : when you type NAME and press F1 you should get help about it. It is in the help.
In 2077 related commands were grouped together. And NAME was not in the AVR-DOS group. So that is maybe why you missed it.
2: EOF markers will not work. I do not know any method in VB/QB that would do like you want. Maybe Josef can better answer this. _________________ Mark |
|
Back to top |
|
|
Jerry
Joined: 25 May 2004 Posts: 40 Location: New York
|
Posted: Thu Feb 13, 2014 9:40 pm Post subject: |
|
|
albertsm wrote: | 1 : when you type NAME and press F1 you should get help about it. It is in the help.
In 2077 related commands were grouped together. And NAME was not in the AVR-DOS group. So that is maybe why you missed it.
2: EOF markers will not work. I do not know any method in VB/QB that would do like you want. Maybe Josef can better answer this. |
Thank you Mark. I am currently using 2076.
When I type name and press F1. "NAME" appears in the keyword to find list box and Modbus Slave Server is highlited in the index tab of the help screen. Scrolling through the select topics titles I see nothing for "NAME"
If I enter "NAME" in the search box of help. I see about 100 titles displayed, none of which are "NAME". If I click on AVR-DOS title in help. The word "Name" is highlighted blue throughout the AVR-DOS help screen but nothing to do with the "NAME" function of AVR-DOS.
Jerry |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Feb 13, 2014 9:47 pm Post subject: |
|
|
Jerry, it works in 2077. Not in 2076.
maybe rmdir and mkdir are not in the help too?
you can best have a look at the on line help for bascom-avr, that is 2077. _________________ Mark |
|
Back to top |
|
|
Jerry
Joined: 25 May 2004 Posts: 40 Location: New York
|
Posted: Thu Feb 13, 2014 10:10 pm Post subject: |
|
|
OK I will move to 2077. I didn't realize this was new.
thank you Mark
Jerry |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Thu Feb 13, 2014 10:16 pm Post subject: |
|
|
NAME is not new, only new in the help.
MKDIR, CHDIR and RMDIR were added to the help in 2076.
The functions them self existed for a longer time. They were added later by Josef and tested, and described in the help later. _________________ Mark |
|
Back to top |
|
|
|