equal
deleted
inserted
replaced
103 return path |
103 return path |
104 |
104 |
105 def localpath(path): |
105 def localpath(path): |
106 return path |
106 return path |
107 |
107 |
|
108 def samefile(fpath1, fpath2): |
|
109 """Returns whether path1 and path2 refer to the same file. This is only |
|
110 guaranteed to work for files, not directories.""" |
|
111 return os.path.samefile(fpath1, fpath2) |
|
112 |
|
113 def samedevice(fpath1, fpath2): |
|
114 """Returns whether fpath1 and fpath2 are on the same device. This is only |
|
115 guaranteed to work for files, not directories.""" |
|
116 st1 = os.lstat(fpath1) |
|
117 st2 = os.lstat(fpath2) |
|
118 return st1.st_dev == st2.st_dev |
|
119 |
108 if sys.platform == 'darwin': |
120 if sys.platform == 'darwin': |
109 def realpath(path): |
121 def realpath(path): |
110 ''' |
122 ''' |
111 Returns the true, canonical file system path equivalent to the given |
123 Returns the true, canonical file system path equivalent to the given |
112 path. |
124 path. |