Hi Jernej,
Did you try enter inside the directory (i.e. /mnt) and run:
nsh> rm -f .
Maybe it helps.
BR,
Alan
On Thu, Feb 22, 2024 at 3:55 AM Jernej Turnsek
wrote:
> Hi, I have accidentally written a lot of files on my sdcard and now I would
> like to delete them. I have tried with rm * comm
I did a quick test in the sim:nsh
nsh> mount
/bin type binfs
/etc type romfs
/proc type procfs
/tmp type vfat
nsh> cd /tmp
nsh> ls
/tmp:
nsh> echo "T1" > test1
nsh> echo "T2" > test2
nsh> echo "T3" > test3
nsh> ls
/tmp:
test1
test2
test3
nsh> rm -r .
nsh: rm: unlink failed: 1
nsh> ls
Maybe the SD card filesystem is mounted read-only?
For instance when filesystem is corrupted it may mount ready-only on
some systems until fsck marks it clean?
--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
On 2/23/2024 5:57 PM, Alan C. Assis wrote:
/tmp:
test1
test2
test3
nsh> rm -r .
nsh: rm: unlink failed: 1
nsh> ls
/tmp:
nsh>
It reported error "unlink failed: 1", but removed all the files.
1 = EPERM, Operation not permitted
I suspect that occurred when it tried to rm ".". Try puttin
On 2/23/2024 6:19 PM, Gregory Nutt wrote:
On 2/23/2024 5:57 PM, Alan C. Assis wrote:
/tmp:
test1
test2
test3
nsh> rm -r .
nsh: rm: unlink failed: 1
nsh> ls
/tmp:
nsh>
It reported error "unlink failed: 1", but removed all the files.
1 = EPERM, Operation not permitted
I suspect that o
Also I noticed rm doesn't accept to remove a mount point:
$ ./nuttx
login: admin
password:
User Logged-in!
nsh> umount /tmp
nsh> mount -t vfat /dev/ram2 /tmp/disk
nsh> mount
/bin type binfs
/etc type romfs
/proc type procfs
/tmp/disk type vfat
nsh> cd /tmp/disk
nsh> ls
/tmp/disk:
nsh>
No, the issue he reported is correct: "rm *" and "rm -r *" are not
supported.
It is a missing feature.
Best Regards,
Alan
On Fri, Feb 23, 2024 at 9:04 PM Tomek CEDRO wrote:
> Maybe the SD card filesystem is mounted read-only?
> For instance when filesystem is corrupted it may mount ready-only
Makes sense since mount points should be "removed" with umount.
rm on a mount point should work. rm does not necessarily remove it. It
maps to unlink which removes the name from mount point, or file. Logic
in the VFS will detect detect the open count. The entity will exist
nameless until