User: Password:
|
|
Subscribe / Log in / New account

Control characters in file names

Control characters in file names

Posted Nov 23, 2010 21:26 UTC (Tue) by ballombe (subscriber, #9523)
In reply to: Control characters in file names by Yorick
Parent article: Ghosts of Unix past, part 4: High-maintenance designs

You never seen a legitimate use ? I thought this was the oldest trick in the book.

do
touch `printf "\01"`
chmod 000 `printf "\01"`
and now, if you ever do 'rm -f *' by mistake, you will get a chance to abort before any files are deleted.

This is also useful to name image files: use a two dimensional ascii-art rendition of the image, this is much more intuitive than _dsc2919.jpg. After all a picture is worth a thousand word... and in ascii-art it _is_ a thousand word!)


(Log in to post comments)

Control characters in file names

Posted Nov 23, 2010 21:31 UTC (Tue) by jzbiciak (subscriber, #5246) [Link]

I'd hate to type filenames on your computer. Even tab expansion would be murder with your digital pictures.

Control characters in file names

Posted Nov 24, 2010 18:29 UTC (Wed) by ballombe (subscriber, #9523) [Link]

This is a minor quibble. Just add the picture number in the left-up corner and add a subdirectory with symlinks from the numbers to the image.

Control characters in file names

Posted Nov 24, 2010 6:20 UTC (Wed) by mfedyk (guest, #55303) [Link]

oooh, I like.

now if the camera could write vfat long file names without patents...

Control characters in file names

Posted Nov 24, 2010 8:05 UTC (Wed) by nix (subscriber, #2304) [Link]

I don't understand why people would want cameras to write long filenames anyway. They all name their files in robotic and boring fashion and the filenames are essentially meaningless nonces: all the actual lookup is always done via EXIF tags from some reader application.

Control characters in file names

Posted Nov 24, 2010 17:10 UTC (Wed) by sorpigal (subscriber, #36106) [Link]

It seems like the point would be to make cameras save pictures with ascii-art names depicting their contents, which would be arguably more useful than the robotic, boring names they use now.

ASCII Art file names

Posted Nov 25, 2010 7:49 UTC (Thu) by rgmoore (✭ supporter ✭, #75) [Link]

It would be great until you took two pictures that gave the same ASCII-art representation but were different in some other important way. For example, astrophotographers who want to do image stacking would find it very inconvenient. So would people who use some bracketing options, like color balance bracketing or even exposure bracketing with 1/3 stop increments. Sequence numbers may be boring and uninformative, but they stop you from accidentally overwriting an important picture.

Control characters in file names

Posted Nov 25, 2010 3:15 UTC (Thu) by mrshiny (subscriber, #4266) [Link]

You know, KDE and other modern shells can show you a tiny representation of the image on your disk without resorting to ascii-art filenames... Just sayin'.

Control characters in file names

Posted Dec 1, 2010 21:56 UTC (Wed) by cgwaldman (subscriber, #9061) [Link]

No, if you do 'rm -f *' it will delete every file. That's what the '-f' (force) flag does. This trick will only protect you from 'rm *', not the stronger 'rm -f *'. (Cute idea though...)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds