[Swift-user] again about absolute and relative paths

Lorenzo Pesce lpesce at uchicago.edu
Fri Dec 7 16:00:16 CST 2012

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 mailing list