try to create a real file viewer

This commit is contained in:
Edouard Dupin 2011-08-03 18:01:04 +02:00
parent ab74a7c516
commit 55681d1dac
2 changed files with 27 additions and 8 deletions

View File

@ -111,13 +111,32 @@ void Edn::File::SetCompleateName(Edn::String &newFilename)
char buf[MAX_FILE_NAME];
memset(buf, 0, MAX_FILE_NAME);
char * ok;
// Get the real Path of the current File
ok = realpath(newFilename.c_str(), buf);
if (!ok) {
EDN_ERROR("Can not find real name of \"" << newFilename.c_str() << "\"");
Edn::String destFilename;
if (newFilename.Size() == 0) {
destFilename = "no-name";
} else {
EDN_DEBUG("file : \"" << newFilename.c_str() << "\" done:\"" << buf << "\" ");
destFilename = newFilename;
}
if ('/' != *destFilename.c_str()) {
// Get the command came from the running of the program :
char cCurrentPath[FILENAME_MAX];
if (!getcwd(cCurrentPath, FILENAME_MAX)) {
return;
}
cCurrentPath[FILENAME_MAX - 1] = '\0';
Edn::String tmpFilename = destFilename;
destFilename = cCurrentPath;
destFilename += '/';
destFilename += tmpFilename;
}
// Get the real Path of the current File
ok = realpath(destFilename.c_str(), buf);
if (!ok) {
EDN_ERROR("Can not find real name of \"" << destFilename.c_str() << "\"");
} else {
EDN_DEBUG("file : \"" << destFilename.c_str() << "\" done:\"" << buf << "\" ");
// TODO : try again with no name
}
}

View File

@ -17,7 +17,8 @@
- Project manager phase 1
# action a faire (ordonner) :
- sys : la methode de close est mauvaise...
- HL : Parsing caracter/caractère et plus section par section ...
- sys : real filename ...
- ctags : Back simple et multiple
- ctags : Multiple files
- sys : search complet, replace complet
@ -36,7 +37,6 @@
- gui : ascenceur quand nécessaire
- gui : Demander la création de nouveaux fichier quand il n'existe pas (a l'ouverture en ligne de commande)
- Catch Shift+TAB
- Correction du bug de display quand on vas vers la fin, et mise en place d'un display qui met toujours le meme temps
- Correction du bug des entré bizard tel que les chapot et les guillemets
- gui : Parameters : et en autre la taille de la police ... et voir pour la récupérer sur le system... et ce serait cool...
- PB de copier coller sur les éà ...