parameters: (filename)
docstring: Obtains the size of a given file.
  
      @filename - Path to the file.
  
      Returns the size of the file.
docstring_summary: Obtains the size of a given file.
docstring_tokens: Obtains the size of a given file .
function: def file_size(filename):
      '''
      Obtains the size of a given file.
  
      @filename - Path to the file.
  
      Returns the size of the file.
      '''
      # Using open/lseek works on both regular files and block devices
      fd = os.open(filename, os.O_RDONLY)
      try:
          return os.lseek(fd, 0, os.SEEK_END)
      except KeyboardInterrupt as e:
          raise e
      except Exception as e:
          raise Exception("file_size failed to obtain the size of '%s': %s" % (filename, str(e)))
      finally:
          os.close(fd)
function_tokens: def file_size ( filename ) : # Using open/lseek works on both regular files and block devices fd = os . open ( filename , os . O_RDONLY ) try : return os . lseek ( fd , 0 , os . SEEK_END ) except KeyboardInterrupt as e : raise e except Exception as e : raise Exception ( "file_size failed to obtain the size of '%s': %s" % ( filename , str ( e ) ) ) finally : os . close ( fd )