Looking for C++ code to get file informations like file size, date created, etc. Any suggestions? -Tamim
Looking for C++ code to get file informations like file size, date created, etc. Any suggestions? -Tamim
XXXX@XXXXX.COM (Janice) writes: Try "man stat" Cheers, -- In order to understand recursion you must first understand recursion. Remove /-nsp/ for email.
From a command line run: man 2 stat Larry -- Anti-spam address, change each 'X' to '.' to reply directly.
Well, what I did was to write a simple awk script and call that from one of my programs and redirect its output to a file which I could parse in the program. I am sure there are better ways to do this but this one cheap and easy way to do it. More information regarding the purpose of you trying to do this would probably help me give u a better advice.... Ankur
1.how to test file size and creation date in Bash command file
I have a Bash command file with a for loop to process all the files in a directory. But what I want to do is process only files larger than 1 MB that were created on the day the command file is run. How do I test the file size and file creation date in a Bash command file? Thanks, Jeff
2.Creating a tar file with only files that have changed since a specified date
In article < XXXX@XXXXX.COM >, Luuk says... > jeremy schreef: > > > > tar -cf fred.tar `find . -mtime -10` > > > > Doesn't get much simpler, huh? > > > > thanks for your patience > > > > ok, suc6, until you get this error from tar: > "Argument list too long" > > than you'll have to use Google again to find a solution for that too ;-) > > Actually I may have been a bit hasty :( whilst the command find . -mtime -2 lists all files changed in the last 2 days (240) I now see this is NOT a valid argument to the tar commnd: tar -cf fred.tar `find . -mtime -2 ` I ctrl+c the tar after a few seconds - had 1300 files already written. is there a way to appaned e.g. the \ char to the end of each line returned by find? Or have I missed something obvious? -- jeremy
3.Creating a tar file with only files that have changed since a specified date
In article < XXXX@XXXXX.COM >, Luuk says... > > ls -l > > > > I would have thought (wondered) it was a function of the ls command that > > could display the output in the format I want? > > > > If push comes to shove I can pipe the output through cut to ignore the > > stuff I don't want I guess but would rather use the simplest method. > > > > /home/luuk $ find ~luuk -name "*.log" > will find any log-file in my home-dir, or in one of its sub-folders.. > > to find out where find is on my system: > /home/luuk # find / -name find > /usr/bin/find > /usr/lib64/find > Apologies - the output I want is the default output from find. [smacks forehead] So this creates my tar file with just the files that have changed in the last 10 days: tar -cf fred.tar `find . -mtime -10` Doesn't get much simpler, huh? thanks for your patience -- jeremy
4.Creating a tar file with only files that have changed since a specified date
(I did also post this to comp.unix.solaris a few minutes ago so apologies if this is a breach of etiquette) Hi, am using Solaris 9. Is there a simple way to crate a tar file containing only those files that have changed since a given date (e.g. 31-may-2008)? Could you point me to a web site with examples? We have around 8gb in a compressed tar file generated last weekend. This file was generated via cd /usr/topdir tar -cf mytarfile.tar * (using pipes to pipe through gzip) What I would like to be able to do is create another tar file with just the files that have changed since a the date on which we made that tar file. Appreciate any pointers. -- jeremy
5.Creating a tar file with only files that have changed since a specified date
In article < XXXX@XXXXX.COM >, Luuk says... > jeremy schreef: > > (I did also post this to comp.unix.solaris a few minutes ago so > > apologies if this is a breach of etiquette) > > > > > > Hi, am using Solaris 9. Is there a simple way to crate a tar file > > containing only those files that have changed since a given date (e.g. > > 31-may-2008)? > > > > Could you point me to a web site with examples? > > > > We have around 8gb in a compressed tar file generated last weekend. > > > > This file was generated via > > > > cd /usr/topdir > > tar -cf mytarfile.tar * > > > > (using pipes to pipe through gzip) > > > > What I would like to be able to do is create another tar file with just > > the files that have changed since a the date on which we made that tar > > file. > > > > Appreciate any pointers. > > > > > > > > find . -mtime -1 -type f -exec ls -l {} \; > > will only list those file that got changed during the last 24 hours... Thanks - great start for me, really appreciate the help. So then I need to take each returned file and place it into a tar file Something like: tar -cf fred.tar `find . -mtime -1 -type f -exec ls {} \;` How do I make the "find" command give me a list of files expressed as [path_relative to pwd]/filename ? e.g. directory structure may be dir1/subdirt/filea dir2/subdiru/fileb dir3/subdirv/filec dir4/subdirw/filed dir5/subdirx/filee and I want to place the changed/new files into the tar file retaining that directory structure. Possible? -- jeremy
6. Creating a tar file with only files that have changed since a specified date
7. Creating a tar file with files changed since fixed date
8. Looking for code that can parse C-language declarations to create special data files
Users browsing this forum: No registered users and 52 guest