Re: Accented chars in filenames issue
On 06/25/2011 11:37 AM, lee wrote:
> lee <lee@yun.yagibdah.de> writes:
>
>> ,----
>> | lee@yun:~/tmp/naming$ ls -la
>> | insgesamt 52
>> | drwxr-xr-x 2 lee lee 4096 25. Jun 15:48 .
>> | drwx------ 12 lee lee 32768 25. Jun 15:48 ..
>> | -rw-r--r-- 1 lee lee 116 9. Jun 16:35 -rf
>> | -rw-r--r-- 1 lee lee 94 7. Jun 21:19 rm -rf *
>> | -rw-r--r-- 1 lee lee 94 7. Jun 21:17 rm -rf \*
>> | -rw-r--r-- 1 lee lee 94 7. Jun 21:16 rm -rf 1307474137
>> | lee@yun:~/tmp/naming$
>> `----
>>
>> I haven't tried touch, it'll probably work the same. A nice application
>> might be to provide "rm -rf *" as a filename for an attachment to an
>> email?
>>
>> Now how to remove these files gives me something to think about very
>> carefully ... :(
>
> [cut from here]
>
> #include <stdio.h>
> #include <unistd.h>
> #include <errno.h>
> #include <error.h>
>
>
> // the name of the file to be removed:
> #define NAME "none"
>
>
> int main(int argc, char *argv[] ) {
> int ret;
> int err;
>
> ret = unlink(NAME);
> err = errno;
> if(ret) {
> error(0, err, "unlinking '%s'", NAME);
> }
> else {
> printf("'%s' successfully unlinked\n", NAME);
> }
>
> return ret;
> }
>
> [cut to here]
>
> Save it as "removing.c", adjust the name of the file you want to remove
> and run gcc -Wall -Os -o removing removing.c. Than run ./removing to
> remove the file.
Why all the touble?
$ rm 'rm -rf *'
does the job. Or use a file manager.
--
If Robert Di Niro assassinates Walter Slezak, will Jodie Foster marry
Bonzo??
Eduardo M KALINOWSKI
eduardo@kalinowski.com.br
Reply to: