Fixes #2623: several fixes:
Disable menu for [..], Refresh file list after delete, Copy destination can be a directory, Prevent copy/paste into the same directory, Enabled renaming of directories and files without extension, Removed delete menu option for directories, Several simulator filesystem functions improved
This commit is contained in:
committed by
Bertrand Songis
parent
f5f1a052ca
commit
28b9a70e6b
@@ -929,14 +929,24 @@ FRESULT f_mkdir (const TCHAR*)
|
||||
return FR_OK;
|
||||
}
|
||||
|
||||
FRESULT f_unlink (const TCHAR*)
|
||||
FRESULT f_unlink (const TCHAR* name)
|
||||
{
|
||||
char *path = convertSimuPath(name);
|
||||
if (unlink(path)) {
|
||||
TRACE("f_unlink(%s) = error %d (%s)", path, errno, strerror(errno));
|
||||
return FR_INVALID_NAME;
|
||||
}
|
||||
TRACE("f_unlink(%s) = OK", path);
|
||||
return FR_OK;
|
||||
}
|
||||
|
||||
FRESULT f_rename(const TCHAR *oldname, const TCHAR *newname)
|
||||
{
|
||||
TRACE("f_rename(%s, %s)", oldname, newname);
|
||||
if ( rename(oldname, newname) < 0) {
|
||||
TRACE("f_rename(%s, %s) = error %d (%s)", oldname, newname, errno, strerror(errno));
|
||||
return FR_INVALID_NAME;
|
||||
}
|
||||
TRACE("f_rename(%s, %s) = OK", oldname, newname);
|
||||
return FR_OK;
|
||||
}
|
||||
|
||||
@@ -966,7 +976,12 @@ int f_printf (FIL *fil, const TCHAR * format, ...)
|
||||
|
||||
FRESULT f_getcwd (TCHAR *path, UINT sz_path)
|
||||
{
|
||||
strcpy(path, ".");
|
||||
// remove simuSdDirectory from the cwd
|
||||
char * cwd = get_current_dir_name();
|
||||
std::string c(cwd + strlen(simuSdDirectory));
|
||||
free(cwd);
|
||||
strcpy(path, c.c_str());
|
||||
TRACE("f_getcwd() = %s", path);
|
||||
return FR_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user