kbaseattic / KBaseFBAModeling

Flux balance modeling service. Deploys both the client and service codes.
MIT License
6 stars 11 forks source link

Job path bug #39

Closed samseaver closed 9 years ago

samseaver commented 9 years ago

I'm unsure if this is necessary now, but I would get a problem from the API not being able to find the job directory.

I traced the problem to the use of substr() in this function. If the $path variable does not have the trailing slash, it's overall length is one character too short to properly include the slash in $fulldir and as such, the resulting $jobid variable would then include the slash.

One fix, implemented here, is to ensure that the $path variable is long enough. The alternative, if the $jobid itself is of a fixed length, is to use a negative offset in the substr() function.

I only encounter this problem in my local implementation of the API, and I believe it is bypassed if the $jobid is correctly set in the first place, which of course, I must not be doing in my local scripts.

samseaver commented 9 years ago

I'm closing this PR, I don't understand why all these commits are here, so I'm pulling out to ensure that my branch will only have one commit.