Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: open last saving directory for consecutive 'save to file' function #96

Closed
SilvinaZabalaTravers opened this issue Apr 20, 2016 · 6 comments

Comments

@SilvinaZabalaTravers
Copy link

Hi! Just a minor issue. The second time you use 'Save to file', while analyzing the same imrmc file, the 'save' directory changes and instead of exporting to the last one used or where the current analyzed imrmc file is, it returns to the root.

@qigongFDA
Copy link
Contributor

We find the problem is due to Mac and Linux system. They use difference slash with Windows. We need to find a method to solve the it.

@qigongFDA
Copy link
Contributor

qigongFDA commented Jul 13, 2016

I find the source of these problem is InputFile.filename. We got it by function getPath(). It saves path and name of input file as Stirng (C:\Users\ReaderStudy\Documents\qigong\imrmc_inputfile\test_new1.imrmc). We used "filename.lastIndexOf("")" function to separate it to path and name. But in Linux and Mac InputFile.filename will be (C:/Users/ReaderStudy/Documents/qigong/imrmc_inputfile/test_new1.imrmc.) Then we can't separate path and name by "filename.lastIndexOf("")" function.

I think there are 2 methods to solve this problem

  1. When we generate InputFile.filename, we could replace all "/" by "", and keep all other code. In windows, we can't name a file with ether "/" or "". But in Linux, we could name a file with "". Mac allows user to name the file with both slash. I don't think user will name file like that very often. We could also mention this in user manual. But it is a potential problem.
  2. We could use getName() and getParent() functions to get input file path and name individually and save them in 2 variables. This method will not create the potential problem mentioned in first method. But we need a new variable and need to change several parts of code.

@brandon-gallas
Copy link
Member

I subscribe to the following:
"Rather than keeping everything string-based, you should use a class which is designed to represent a file system path."

qigongFDA added a commit that referenced this issue Jul 15, 2016
…Windows, MAC, Linux)

Separate variable filename into 3 variables filePathAndName(path + name, which is same as old variable filename), filePath (folder path of input file) and fileName (file name only). Set this 3 variables when user load input file. Then we don't need lastIndexOf to separate them.
@qigongFDA
Copy link
Contributor

Could we close it?

@SilvinaZabalaTravers
Copy link
Author

Sure, thank you. Silvina

On Tue, Oct 4, 2016 at 11:05 AM Qi Gong notifications@github.com wrote:

Could we close it?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#96 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AOokKXi3rnUsHwZx0PRDlUS6sbqCfXshks5qwmsegaJpZM4IMBOt
.

Silvina Zabala Travers, MD
Radiology resident - UdelaR.
+1 787 239 5834

  • 598 99 382 992

@brandon-gallas
Copy link
Member

Works for me. Nice job. I'm closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants