Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(linux_cpu), | intent(inout) | :: | this |
elemental impure subroutine set_cpu_online(this)
class(linux_cpu), intent(inout) :: this
integer :: nunit, stat
logical :: ex
character(len=:), allocatable :: file_name
this%online = 1
file_name = this%path_cpu//"/online"
inquire(file=file_name, exist=ex)
if (ex) then
open(newunit=nunit, file=file_name, iostat=stat)
write(nunit, '(i0)') this%online
close(nunit)
else
! error stop "file not found: "//file_name
endif
end subroutine set_cpu_online