MCPcopy Create free account
hub / github.com/bleachbit/bleachbit / count_swap_linux

Function count_swap_linux

bleachbit/Memory.py:40–47  ·  view source on GitHub ↗

Count the number of swap devices in use

()

Source from the content-addressed store, hash-verified

38
39
40def count_swap_linux():
41 """Count the number of swap devices in use"""
42 count = 0
43 with open("/proc/swaps") as f:
44 for line in f:
45 if line[0] == '/':
46 count += 1
47 return count
48
49
50def get_proc_swaps():

Callers 3

test_count_linux_swapMethod · 0.90
disable_swap_linuxFunction · 0.85
wipe_swap_linuxFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_count_linux_swapMethod · 0.72