Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / tools / build / win / touch_sentinel.py
blob19dd1d4a4ec836f0f8406534e22cca4ae97a0d23
1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 import os
6 import sys
8 def main(args):
9 """Touches a file.
11 Args:
12 args: An argument list, the first item of which is a file to touch.
13 """
14 try:
15 os.makedirs(os.path.dirname(args[0]))
16 except OSError:
17 pass
18 with open(args[0], 'a'):
19 os.utime(args[0], None)
20 return 0
23 if __name__ == '__main__':
24 sys.exit(main(sys.argv[1:]))