Shop OBEX P1 Docs P2 Docs Learn Events
C: stdio rename function problem????? — Parallax Forums

C: stdio rename function problem?????

idbruceidbruce Posts: 6,197
edited 2015-05-06 06:04 in Propeller 1
As you can see below, I seem to be having a problem, with the rename function.
#include <stdio.h>

int main(void)
{
    char *testz;
    char *testp;
    
    testz = "/test/z";
    testp = "/test/p";
    
    rename(testz, testp);
    
    return 0;
}
Project Directory: C:/Documents and Settings/Bruce/Desktop/Rename/

SimpleIDE Version 1.0.2
C:/Documents and Settings/Bruce/My Documents/SimpleIDE/Learn/Simple Libraries/
C:/Documents and Settings/Bruce/My Documents/SimpleIDE/ Updated on: 2015-02-14

propeller-elf-gcc.exe -v GCC 4.6.1 (propellergcc_v1_0_0_2408)
propeller-elf-gcc.exe -I . -L . -o cmm/Rename.elf -Os -mcmm -Wall -m32bit-doubles -fno-exceptions -std=c99 Rename.c
C:\DOCUME~1\Bruce\LOCALS~1\Temp\ccM8hivF.o: In function `_main':
(.text+0x9): undefined reference to `_rename'
collect2: ld returned 1 exit status
Done. Build Failed!

Check source for bad function call or global variable name `_rename'

As a side note, I seem to have created an undeletable directory. Any suggestions besides reformatting.

Comments

  • Dave HeinDave Hein Posts: 6,347
    edited 2015-05-05 18:45
    The PropGCC library doesn't contain the rename function. The driver that we use, dosfs, doesn't have a function to change the name in the directory, so this would have to be written from scratch. It's not too difficult to write the function, but nobody has done it yet for PropGCC.
  • idbruceidbruce Posts: 6,197
    edited 2015-05-05 20:30
    Dave

    Thanks for the explanation. Not that it is any big deal, but perhaps stdio.h should be updated to either remove or comment out the declaration, until a function is written.
  • Dave HeinDave Hein Posts: 6,347
    edited 2015-05-06 05:20
    I'm sure there are lots of functions that have prototypes in header functions, but aren't in the library. It would be better to have a document or a FAQ sheet that lists limitations and functions that aren't supported.
  • idbruceidbruce Posts: 6,197
    edited 2015-05-06 06:04
    Dave
    I'm sure there are lots of functions that have prototypes in header functions, but aren't in the library. It would be better to have a document or a FAQ sheet that lists limitations and functions that aren't supported.

    I thought perhaps one or two, but if there are a lot of them, that makes good sense.
Sign In or Register to comment.