lkml.org 
[lkml]   [2014]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 1/2] perf tools: Ensure --symfs ends with '/'
Date
Hi Arnaldo,

On Thu, 31 Jul 2014 09:26:21 -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jul 31, 2014 at 01:25:52PM +0900, Namhyung Kim escreveu:
>> Are you still against my approach - adding '/' at the end of the symfs
>> string itself? It seems that mine is simpler and shorter.
>
> Yes, I am.
>
> We are not just concatenating two strings, we are joining two path
> components.
>
> I think it is more clear and elegant to do it as python os.path.join()
> does.

Then I think you also need to care about trailing and leading '/' in the
components so that, say, joining '/home/' and '/namhyung/' can result in
'/home/namhyung/' not '/home///namhyung/'.

Btw, it seems like python's os.path.join() just use latter if it's an
absolute path.

$ python
Python 2.7.3 (default, Jul 24 2012, 10:05:38)
[GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os.path
>>> os.path.join('/home/', '/namhyung/')
'/namhyung/'
>>>


Thanks,
Namhyung


\
 
 \ /
  Last update: 2014-08-01 02:21    [W:0.082 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site