xref: /aosp_15_r20/external/angle/scripts/file_exists.py (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1#!/usr/bin/python3
2# Copyright 2019 The ANGLE Project Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5#
6# Simple helper for use in 'gn' files to check if a file exists.
7
8from __future__ import print_function
9
10import os, shutil, sys
11
12
13def main():
14    if len(sys.argv) != 2:
15        print("Usage: %s <path>" % sys.argv[0])
16        sys.exit(1)
17
18    if os.path.exists(sys.argv[1]):
19        print("true")
20    else:
21        print("false")
22    sys.exit(0)
23
24
25if __name__ == '__main__':
26    main()
27