Register

Rename Files/Directories (C)

Learn how to program. Code snippets for creating sprites etc. Submit your own or use those of others.
Senior Member
User avatar
Posts: 604
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750 G II, Casio fx-9750 G II (SH4), Casio fx-9860G, Casio fx-9860 G SD, Casio fx-9860G Slim, Casio fx-9860 GII SD, Casio fx-9860 GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG 20, Casio Classpad fx-cp400, Casio fx-CG 50

Rename Files/Directories (C)

Postby SimonLothar » Sun May 06, 2012 9:17 am

Code: Select all
#define FILENAMESIZE 0x10A
// FILENAMESIZE is 0x21 on the fx-9860-series
#define FONTCHARACTER               unsigned short
FONTCHARACTER oldname[ FILENAMESIZE ];
FONTCHARACTER newname[ FILENAMESIZE ];
int result = 0;

/*
// rename a directory: verified on a fx-CG
   Bfile_StrToName_ncpy( oldname, "\\\\fls0\\ABC", FILENAMESIZE );
   Bfile_StrToName_ncpy( newname, "\\\\fls0\\DEF", FILENAMESIZE );
*/
/*
// rename a file in the same directory: verified on a fx-CG
   Bfile_StrToName_ncpy( oldname, "\\\\fls0\\DEF\\TEST2.ASM", FILENAMESIZE );
   Bfile_StrToName_ncpy( newname, "\\\\fls0\\DEF\\TEST3.ASM", FILENAMESIZE );
*/
// rename a file and move it to a different directory: verified on a fx-CG
   Bfile_StrToName_ncpy( oldname, "\\\\fls0\\DEF\\TEST3.ASM", FILENAMESIZE );
   Bfile_StrToName_ncpy( newname, "\\\\fls0\\TEST2.ASM", FILENAMESIZE );

   result = Bfile_RenameEntry( oldname, newname );


Bfile_StrToName_ncpy: see fx_calculators_SuperH_based.CHM http://www.casiopeia.net/forum/downloads.php?view=detail&df_id=72

int Bfile_RenameEntry( const FONTCHARACTER *oldname, const FONTCHARACTER *newname );
on the fx-CG-series: syscall 0x1DB3 (verified)
on the fx-9860-series: syscall 0x0438 (only verified for directory renaming; seems to fail with files)
I'll be back!

Member
User avatar
Posts: 27
Joined: Mon Apr 09, 2012 7:09 pm
Location: France

Postby PierrotLL » Sun May 06, 2012 12:00 pm

Nice :)

Senior Member
Posts: 369
Joined: Tue Jan 03, 2012 11:24 pm
Calculators: Casio Afx 1.0, Casio fx-9860 GII SD, Casio Classpad 330, Casio fx-CG 20, Casio Classpad fx-cp400

Postby helder7 » Sun May 06, 2012 2:21 pm

thanks! :cool:
SiO2 + CaCO3 ----------> CaSiO3 + CO2

Return to Tutorials & Code Snippets

Who is online

Users browsing this forum: No registered users and 1 guest