Home Forums Gamescan Chat42 About
* Login   * Register * FAQ    * Search
It is currently Wed 08-27-2025 4:11PM

All times are UTC - 6 hours




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: find files and mark read only
PostPosted: Mon 03-27-2006 10:20PM 
Offline
General
User avatar

Joined: Mon 09-22-2003 3:29PM
Posts: 4317
Location: Find out on irc

Source: Fidelity
ok so im looking for something that searches for files with the same basic name and marks all the ones it finds as read only... it has to be quick, and i can specify the dir for it to look into

_________________
_______Notebook_________Gaming - Circa 2008ish
proc___T8300____________Q6600
clock-----------2.4GHz-----------
ram--------------4GB------------
vid__GF8600M GT 256MB__2xGF8800GTS 512MB sli
hdd____160GB_______3.5TBw/parity on a 3ware card


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Mon 03-27-2006 10:53PM 
Offline
Colonel

Joined: Sun 05-01-2005 4:29PM
Posts: 501

Source: Off Campus
It would be really easy to make a shell script to do that...if only windows had shell scripting...


Top
 Profile  
    
 Post subject:
PostPosted: Mon 03-27-2006 11:19PM 
Offline
Major
User avatar

Joined: Wed 01-19-2005 7:55PM
Posts: 261
Location: Dagobah

Source: EE Building
Well, if you're running .NET 2.0 you can write "shell scripts for Windows"...

32b MSH ~ http://www.microsoft.com/downloads/deta ... layLang=en
64b MSH ~ http://www.microsoft.com/downloads/deta ... layLang=en
MSH Docs ~ http://www.microsoft.com/downloads/deta ... laylang=en

No, I'm not a big fan... but this is considerably better than using batch-files.

_________________
In Soviet Russia, Sparta is this!


Top
 Profile  
    
 Post subject:
PostPosted: Mon 03-27-2006 11:32PM 
Offline
Brigadier General

Joined: Tue 01-22-2002 12:35PM
Posts: 1057
Location: Shawnee Mission, KS

Source: Off Campus
You could also install Perl or Ruby for Windows.


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Mon 03-27-2006 11:53PM 
Offline
Major
User avatar

Joined: Wed 01-19-2005 7:55PM
Posts: 261
Location: Dagobah

Source: EE Building
Do you have any experience with Ruby?

I've heard lots of good things; may play with it some this summer.

_________________
In Soviet Russia, Sparta is this!


Top
 Profile  
    
 Post subject:
PostPosted: Tue 03-28-2006 12:13AM 
Offline
Brigadier General

Joined: Tue 01-22-2002 12:35PM
Posts: 1057
Location: Shawnee Mission, KS

Source: Off Campus
I've read lots of introductory stuff and messed around. Nothing serious, although I do have all the Ruby-MySQL, PostgreSQL, GTK and TK bindings installed on my Ubuntu box. I was going to get more serious about it, and then I got laid off from my old job and got hired by another company and it looks like I'll be doing Java programming now, so I had to suspend my Ruby tinkerings to pick up Java.

I usually prefer programming languages that are not very English-oriented. That's not to say I suck at English. Tossing modesty aside, I think I have a better grasp of English than at least 98% of my peers. However, English is English, and computer is computer. I picked up the syntax rules for FORTRAN, C, C++ and assembly really quickly. I struggle to get the syntax of SQL and COBOL right (though I will admit, given correct SQL or COBOL statements, it's really easy to figure out what they do). It's the writing part that's difficult for me. Ruby is just English oriented enough to keep me on my toes, but still grounded in "computer" that it's easy to see the patterns. I think if I sat down and memorized the usual Ruby iterators that the English parts of it would stop giving me trouble.

For example, a 5 iteration loop in C would look like:
Code:
for (i = 1; i <=5; ++i){
//code
}

A 5 iteration loop in Ruby looks like:
Code:
5.times do {
#code
}


That's an example of an iterator (with a block) in Ruby. Blocks look like one of the most interesting parts of the language. They're like "super function pointers".

And then there's Rake. It's like make, except you just write ordinary Ruby in your rakefile instead of hyper-whitespace-sensitive-cryptic-error-messages make-language in your makefile.

So, will it make it in the commercial world? Maybe. I kind of hope it does; I also hope I'll have some time in the future to really play with it.


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Tue 03-28-2006 12:48AM 
Offline
Major
User avatar

Joined: Wed 01-19-2005 7:55PM
Posts: 261
Location: Dagobah

Source: EE Building
Yeah, I'm not a big fan of Makefile syntax. I do like having (control of / a feel for) the building and linking process, however... so I tend to shy away from Visual Studio and bang out Makefiles anyway (it seems like Visual Studio tries to hide too much from me with overtabbed project settings dialogs).

This might be blasphemy, but I'd really like to see a new Make. I dream of a Make that interprets a simple XML file-format to take care of dependencies... no more newline and tab sensitivity... no more more @'s and <'s and general weirdness.

Code:
<MyCompiler>
  <path>/usr/bin/g++</path>
  <flag>omg-optimized</flag>
</MyCompiler>

<Code>
  <src>main</src>
  <src>storage</src>
  <src>killerai</src>
</Code>

<MyLibs>
  <lib>mysql</lib>
  <lib>ai</lib>
</MyLibs>

<MyCoolProgram>
  <compiler>MyCompiler</compiler>
  <code>MyCode</code>
  <libs>MyLibs</libs>
</MyCoolProgram>

"make MyCoolProgram" or something...

_________________
In Soviet Russia, Sparta is this!


Top
 Profile  
    
 Post subject:
PostPosted: Tue 03-28-2006 8:00AM 
Offline
Brigadier General

Joined: Tue 01-22-2002 12:35PM
Posts: 1057
Location: Shawnee Mission, KS

Source: Off Campus
You might want to check out Apache Ant if you want an XML-driven "like make" program.

Also, when I get home, I'll post a rakefile that I wrote to replace the makefile that I used back in 2001 to build Mikelab for CS236 (back when Hilgers taught it).


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Tue 03-28-2006 11:09AM 
Offline
Colonel

Joined: Sun 05-01-2005 4:29PM
Posts: 501

Source: Off Campus
You might also be interested in Jam files


Top
 Profile  
    
 Post subject:
PostPosted: Wed 03-29-2006 2:16AM 
Offline
Major

Joined: Wed 08-18-2004 6:51PM
Posts: 246

Source: Off Campus
What the hell?

If its windows, use the command line and try:

attrib +R "FILENAMESTRING" /S

make FILENAME something with *s for wildcards like thelogfile*.txt for all text files that start with "thelogfile" for a filename.

I'll go through the current directory and all subdirectories and set read-only attribute on all of them. Use cd to switch to other directories, of course.


OR you can go through a bunch of crud to do it.


Top
 Profile  
    
 Post subject:
PostPosted: Wed 03-29-2006 12:20PM 
Offline
"para-dime"
User avatar

Joined: Tue 09-11-2001 2:34PM
Posts: 1084
Location: Off Campus (i.e. not hell)

Source: Off Campus
No, he wants to FIND the ones that are read only. Not make them all read only.

_________________
People with doctorate degrees get to be called Doctor. So yes, I guess I am your Master... bitch


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Wed 03-29-2006 1:19PM 
Offline
Drowning
User avatar

Joined: Sun 08-15-2004 9:36PM
Posts: 4957
Location: ~~~~\o/~~~~~

Source: Off Campus
the way i read it is he wants to find certain files with the same basic name and mark them readonly

_________________
Rolla survivor

Join us in IRC, irc.seek42.net


Top
 Profile E-mail  
    
 Post subject:
PostPosted: Wed 03-29-2006 2:18PM 
Offline
Penis Hater
User avatar

Joined: Mon 02-16-2004 1:47PM
Posts: 2106

Source: CompSci Building
He wants the program to find all files with the same basic name and "marks [them] read only"

_________________
My girlfriend went to London and all I got was this lousy sig.

My new title was my idea...


Top
 Profile  
    
 Post subject:
PostPosted: Wed 03-29-2006 2:34PM 
Offline
"para-dime"
User avatar

Joined: Tue 09-11-2001 2:34PM
Posts: 1084
Location: Off Campus (i.e. not hell)

Source: Off Campus
oh... I guess I emphasized in the wrong way. I thought he meant search for some files with similar names, and return the ones that are read only. I lose @ the intrawebs.

_________________
People with doctorate degrees get to be called Doctor. So yes, I guess I am your Master... bitch


Top
 Profile E-mail  
    
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group