MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / can_write_file

Method can_write_file

task.py:1952–1960  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1950
1951 @staticmethod
1952 def can_write_file():
1953 test_file = '/etc/init.d/bt_10000100.pl'
1954 write_file(test_file, 'True')
1955 if os.path.exists(test_file):
1956 if read_file(test_file) == 'True':
1957 os.remove(test_file)
1958 return True
1959 os.remove(test_file)
1960 return False
1961
1962 def stop_syssafe(self):
1963 ret = self.can_write_file()

Callers 1

stop_syssafeMethod · 0.95

Calls 4

write_fileFunction · 0.70
read_fileFunction · 0.70
existsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected