2 # Copyright 2019 The Chromium Authors
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5 """Prints the target paths of the given symlinks.
7 Prints out each target in the order that the links were passed in.
15 for link_name in sys.argv[1:]:
16 if not os.path.islink(link_name):
17 sys.stderr.write("%s is not a link" % link_name)
19 target = os.readlink(link_name)
20 if not os.path.isabs(target):
21 target = os.path.join(os.path.dirname(link_name), target)
22 print(os.path.realpath(target))
26 if __name__ == '__main__':