#[SOLVED] File in ls doesn't exist

17 messages · Page 1 of 1 (latest)

naive nacelle
#

I noticed a weird file in my home directory which had a name consisting of non ascii characters. When I try to remove or delete it, I get an error saying it doesn't exist. I had this issue on Dolphin, terminal (rm) as well as when trying to renaming the file programmatically (nodejs, which i'm pretty sure is just an interface for syscalls)

#

The images are: the file on ls -la, when i hit tab on the terminal emulator, the appearance of the file on Dolphin (for some reason has a lock icon on it)

#

what i tried with nodejs (i used nodejs so I don't have to deal with copy-paste issues since the nonascii characters may cause trouble):

> let dir = fs.readdirSync('./');
undefined
> dir[dir.length-1]
'�����U'
> fs.renameSync(dir[dir.length-1], 'test.file');
Uncaught Error: ENOENT: no such file or directory, rename '�����U' -> 'test.file'
    at Object.renameSync (node:fs:1026:3) {
  errno: -2,
  syscall: 'rename',
  code: 'ENOENT',
  path: '�����U',
  dest: 'test.file'
}
#

(reading the file threw a similar ENOENT error)

rigid scarab
#

Type "ls -i" to get the inode of the file/dir and then:
find . -maxdepth 1 -type f -inum INODE -delete
to delete it. Replace "INODE" with the value you got with "ls -i"

naive nacelle
#

is there a way of reading the contents ?

#

or is it like a file pointer that points to no content?

rigid scarab
#

I have no idea, it looks like a corrupt file to me. Do you tried to open it via editor?

naive nacelle
#

it tells me that the file doesnt exist

#

i did a bit of googling about "inodes"

#

it's a new concept to me

#
[jim@jamo ~]$ find -inum 22807145 -exec cat {} \;
[KCrash]
exe=�����U
platform=xcb
display=:0
appname=�����U
apppath=�~���U
signal=11
pid=670
#

looks like a KDE crash report?

rigid scarab
#

it's just meta data

naive nacelle
#

okay i managed to rename it now it's easier to play around with the file

#

looks like something insignificant though

#

thanks for the help!