Re: Deleting files with wildcard

2024-02-27 Thread Gregory Nutt
On 2/24/2024 11:42 AM, Gregory Nutt wrote: On 2/24/2024 11:39 AM, Jernej Turnsek wrote: @Tomek No, my SD card filesystem is notu mounted read-only, because I can delete single files. I believe that rm * is just not implemented. There is no logic in NSH that expands "*" to a list of all files

Re: Deleting files with wildcard

2024-02-24 Thread Gregory Nutt
On 2/24/2024 11:39 AM, Jernej Turnsek wrote: @Tomek No, my SD card filesystem is notu mounted read-only, because I can delete single files. I believe that rm * is just not implemented. There is no logic in NSH that expands "*" to a list of all files in the current directory.  It is passed on to

Re: Deleting files with wildcard

2024-02-24 Thread Jernej Turnsek
@Tomek No, my SD card filesystem is notu mounted read-only, because I can delete single files. I believe that rm * is just not implemented. On Sat, Feb 24, 2024 at 1:04 AM Tomek CEDRO wrote: > Maybe the SD card filesystem is mounted read-only? > For instance when filesystem is corrupted it may

Re: Deleting files with wildcard

2024-02-24 Thread Jernej Turnsek
Hi Alan, in my case I also get an unlink error, but the files persist. On Sat, Feb 24, 2024 at 12:59 AM Alan C. Assis wrote: > 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: > >

Re: Deleting files with wildcard

2024-02-23 Thread Gregory Nutt
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

Re: Deleting files with wildcard

2024-02-23 Thread Alan C. Assis
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

Re: Deleting files with wildcard

2024-02-23 Thread Alan C. Assis
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>

Re: Deleting files with wildcard

2024-02-23 Thread Gregory Nutt
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

Re: Deleting files with wildcard

2024-02-23 Thread Gregory Nutt
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

Re: Deleting files with wildcard

2024-02-23 Thread Tomek CEDRO
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

Re: Deleting files with wildcard

2024-02-23 Thread Alan C. Assis
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

Re: Deleting files with wildcard

2024-02-23 Thread Alan C. Assis
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 *