Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| kb:code_snippets [2017/12/20 10:02] – created yehuda | kb:code_snippets [2022/01/03 16:03] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| current_process_date.strftime(' | current_process_date.strftime(' | ||
| print("/ | print("/ | ||
| + | </ | ||
| + | |||
| + | <code python> | ||
| + | # Check is file exists on HDFS | ||
| + | import subprocess | ||
| + | |||
| + | def run_cmd(args_list): | ||
| + | proc = subprocess.Popen(args_list, | ||
| + | proc.communicate() | ||
| + | return proc.returncode | ||
| + | |||
| + | def check_is_file_exists_hdfs(filename): | ||
| + | cmd = [' | ||
| + | code = run_cmd(cmd) | ||
| + | return code == 0 | ||
| </ | </ | ||