I found the following code here,
(defun sudo-find-file (file-name) "Like find file, but opens the file as root." (interactive "FSudo Find File: ") (let ((tramp-file-name (concat "/sudo::" (expand-file-name file-name)))) (find-file tramp-file-name)))
But it tries to find the file is sudo mode in the current directory and I have to delete so many characters to reach root directory
How can I define the default opening path in the mentioned code?