[Swift-user] again about absolute and relative paths
hategan at mcs.anl.gov
Fri Dec 7 16:18:28 CST 2012
I'm slightly confused.
You are saying that using @filename gives you an error. Can you be more
explicit about what that error is?
Without CDM, if you have file f<"/a/b/c/name">, your app will find that
file in "a/b/c/name". In other words, there will be a path "a/b/c/name"
in your work directory, so if your app only did "ls -al a/b/c/name" it
If you use CDM direct mode, it should know enough to put back the "/".
On Fri, 2012-12-07 at 16:00 -0600, Lorenzo Pesce wrote:
> Hi Mihael,
> Thanks a lot for your quick reply.
> > Yes. You should not make assumptions about the location of files on the
> > remote side based on the way they are on the swift side. Pass that
> > location to your executable using @filename() instead.
> thanks and yes I am doing that.
> > Now the internal details. Swift restricts files on the app execution
> > side to the work directory. In order to do that for absolute files and
> > prevent clashes (to some extent), it does something equivalent to
> > chroot(workdir), effectively removing the first "/" from the absolute
> > path. The file is staged in to the new location before the app is run.
> So, how will it find the files if I use direct? would not the filename have the "/"
> chopped off and therefore point to the wrong location?
> (which is the last error message I have seen before I gave up and moved to using
> strings and not files, but that approach prevents me from using any form of staging
> without some complex machinery)
> I could conceivably use a relative path (not sure whether it works since it will go upwards, but I can try).
> Can I define a path relative to SWIFT_USERHOME or USER_HOME in swift?
> > Mihael
More information about the Swift-user