Feature Requests item #2837721, was opened at 2009-08-14 10:40
Message generated for change (Comment added) made by popnose
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=379136&aid=2837721&group_id=23629
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Christopher King (popnose)
Assigned to: Nobody/Anonymous (nobody)
Summary: Use relative address in state files
Initial Comment:
On one computer, a file, 1edn.pdb, was opened. The state was saved as 1edn.spt
in the same directory as 1edn.pdb. Both files were transferred to the same
directory on another computer. On that computer, the state file gave an error
because the directory structure was different than on the original computer.
Can the state file be changed to use a relative address for the original file?
Then, I could transfer state files from office to classroom and not have to
worry as much about having the same directory structure.
----------------------------------------------------------------------
Comment By: Christopher King (popnose)
Date: 2009-08-26 15:42
Message:
One approach would be to compare the paths of the script and the data
files.
How about this?
If the operating system is windows then
Are the two files on the same drive?
If no, do nothing.
If yes, does the data file’s path begin with the script file’s
path?
Script in C:\Work\ , data in C:\Work\Data\.
If yes, remove the script’s path from the start of the
data file’s
path.
That turns the data file’s path into a relative
path.
Data file path: data\
If no, find the relative path.
Script in C:\Work\Figures\; Data in
C:\Work\Data\
Remove the drive from the path strings
Script in \Work\Figures\; Data in \Work\Data\
Is the remaining top-level directory present in
both strings?
If yes, remove it
Script in Figures\; Data in
Data\
Repeat until the common top-level
directories have been removed
If no, add “..\” to the data file’s
path for each remaining
directory in the script file’s path
Data file’s path becomes
“..\Figures\”
Now you’ve got a relative path to the data file from the script file’s
directory. (The ..\ means go up one directory level.)
----------------------------------------------------------------------
Comment By: Bob Hanson (hansonr)
Date: 2009-08-24 12:00
Message:
quick work-arounds ---
1) save files on a flash drive, and check that both machines assign the
same drive letter to the drive
2) save files on the web.
3) edit the spt files to remove the C:/xxx/xxx/ part of the file
directory.
4) write a small script that first reads the script file into a variable
using the load() function, makes the character replacements using
replace(), then runs the script using the script() function rather than the
script command.
5) load pdb files using the "=" default RCSB prefix. (load =1edn) This may
be a bit slower, but it ensures getting the same file at least.
I know -- not totally satisfying. But any of these might work. The
problem is figuring out how to specify the correct working directory, and
whether that change should be in the state file or in the reading of it.
Bob
----------------------------------------------------------------------
Comment By: Bob Hanson (hansonr)
Date: 2009-08-23 00:56
Message:
So far I haven't figured out a simple way to do this. Suggestions welcome.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=379136&aid=2837721&group_id=23629
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers