Skip to content

Commit a42d4e4

Browse files
remove ti_CloseAll from ti_Rename*
1 parent 83c2288 commit a42d4e4

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

examples/fileio_rename/src/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,10 @@ void main(void) {
4040
printText(0, 0, "Old Name: ");
4141
printText(10, 0, nameBuffer);
4242

43+
/* Close the old file */
44+
ti_CloseAll();
45+
4346
/* Rename the old file to the new file name */
44-
/* Note: This function closes all open files! */
4547
ti_Rename(oldName, newName);
4648

4749
/* Ensure the new name of the file is correct */

src/fileioc/fileioc.asm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,10 +1163,6 @@ ti_Rename:
11631163
push hl ; hl -> old name
11641164
push bc
11651165

1166-
push af
1167-
call ti_CloseAll
1168-
pop af
1169-
11701166
push de ; new
11711167
push de ; new
11721168
ld de,OP1

src/fileioc/fileioc.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -315,18 +315,18 @@ void ti_GetName(char *name, const ti_var_t slot);
315315
* @param old Old name of file
316316
* @param new New name of file
317317
* @returns 0 if success, 1 if file already exists, 2 any other error occurs.
318-
* @warning: This function closes all open slots!
318+
* @warning It is potentially hazardous to rename an open file. Be sure to close the open file before renaming,
319319
*/
320320
uint8_t ti_Rename(const char *old, const char *new);
321321

322322
/**
323323
* Renames a variable
324324
*
325-
* @param old Old name of file
326-
* @param new New name of file
325+
* @param old Old name of variable
326+
* @param new New name of variable
327327
* @param type Type of variable to rename
328-
* @returns 0 if success, 1 if file already exists, 2 any other error occurs.
329-
* @warning: This function closes all open slots!
328+
* @returns 0 if success, 1 if variable already exists, 2 any other error occurs.
329+
* @warning It is potentially hazardous to rename an open variable. Be sure to close the open variable before renaming,
330330
*/
331331
uint8_t ti_RenameVar(const char *old, const char *new, const uint8_t type);
332332

0 commit comments

Comments
 (0)