Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (2) </ [1] 2 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: find -not -type d< Next Oldest | Next Newest >
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Oct. 06 2007,09:09 QUOTE

I just ran across this way of automatically removing directories from the find list, and thought it might be a good addition to Mikshaws excellent WIKI article on creating an extension from source. (I tried adding the option using the edit function, but the change disappeared.)  (e.g., "find /file -not -type d > file.list" )  (note: I think it requires gnu-utils)

(p. 204 , Damn Small Linux Book)
Back to top
Profile PM 
curaga Offline





Group: Members
Posts: 2163
Joined: Feb. 2007
Posted: Oct. 06 2007,14:32 QUOTE

A simpler way of saying that:

find /file -type f > filelist


--------------
There's no such thing as life. Those mean little jocks invented it ;)
-
Windows is not a virus. A virus does something!
Back to top
Profile PM 
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Oct. 06 2007,15:38 QUOTE

Quote (curaga @ Oct. 06 2007,10:32)
A simpler way of saying that:

find /file -type f > filelist

Indeed...life just keeps getting simpler..
except now comes the question of editing both the WIKI AND
p 204, Damn Small Linux....
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Oct. 06 2007,19:30 QUOTE

Personally I have no intention of editing what I wrote unless there is error in it. The reason for this is that I don't recommend your method of removing all directories indiscriminately. In most cases it should be fine to do that, but occasionally an application wants a particular directory to exist regardless of whether or not it's empty. I've actually even seen some apps that will fail to run if a particular directory is not found. This is poor programming, in my opinion, but it happens sometimes.  In other cases, I think it's a good idea to keep some empty directories in select packages to help the user know where to put certain user-added files, such as plugins, codecs, themes, etc.

I think I've mentioned this before, but I believe solving the problem of file clobbering by removing all directories is similar to opening windows with a hammer. It works, but if you find out later that you needed to keep some of those windows closed you end up making more work for yourself.  The only time directories cause problems is when they are pre-existing directories that have different owners/permissions than those in the extension, and typically this affects only the top few levels of the directory structure. For example, if you have an application that installs to /opt/myapp, the only directory you need to worry about taking out of the package is /opt. Any directories within myapp will not clobber anything unless "myapp" happens to be the name of a pre-existing directory (which it should *not* be unless you're making an extension just for your own use).

Existing directories in a *.dsl extension are of course much more common, so perhaps omitting them all (at least initially) would be much more efficient in that case. I haven't made a *.dsl myself in a couple of years, though, so my personal thought on that is "I don't care what you want to write about that type".  Since nearly everything I do now is *.uci, the only directories that I need to watch are in user.tar.gz...a very minor task. Nothing else has even the slightest chance of clobbering.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
jpeters Offline





Group: Members
Posts: 804
Joined: April 2006
Posted: Oct. 07 2007,07:51 QUOTE

I was thinking it of including it as way of getting a list with only files, if that is what is desired (e.g., backups), not replacing the option of manually deleting folders, when that is required (e.g., an extension that requires an empty directory).  

The example quoted (p.204 Damn Small Linux Book) was for compiling from souce to create a tar.gz extension, not UCI extensions (although the example installed all the files into the /opt directory).
Back to top
Profile PM 
6 replies since Oct. 06 2007,09:09 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (2) </ [1] 2 >/
reply to topic new topic new poll
Quick Reply: find -not -type d

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code