Cross Platform System Commands

Moderator
Posts: 373
Joined: 2006.08
Post: #1
I'm planning on writing some tools to help out the other people on my team, and I want them to be cross platform if at all possible Smile
Therefore, I need a cross-platform library that lets me do things with files and programs. Basically, I need to be able to check what the last modified date is on a file and the file's size (maybe). I'd also like to be able to just issue a command and have the file deleted, or copied to another directory, instead of reading the entire file into a buffer and then writing the buffer out to a file in the desired directory.
I also need to be able to invoke a program and pass it parameters (for example, 'converter.app -someFile.wrl').
Does anyone know of a free library that would allow me to do these things, or do I just need to buckle down and write system-dependent code?

Thank you Smile
-wyrmmage

Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
If you write in Ruby, for example, then you don't have a problem at all -- these functions are all available in the standard library.

What language were you planning on using, and why?
Quote this message in a reply
Moderator
Posts: 373
Joined: 2006.08
Post: #3
I actually hadn't picked a language for the project, so Ruby would probably be fine, although I've never used it. Does Java have commands to do that sort of thing? It seems like it would, and even though I've never liked Java, I could probably bear using it for this project if it simplified things.
I just realized Python probably has something like this, and I already know python. Does it? If so, could someone perhaps point me in the direction of what commands I would use so I can go about googling them for more info?

I'm also going to be parsing the information I get from the file (I'm reading in .wrl files and transferring them into my own file format, as part of the tool), so perhaps there is a language that is both good for this and also good for the file manipulating commands?

Thanks for the help so far Smile
What language would you recommend?
-wyrmmage

BTW: congrats on 4300 posts Rasp

Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
I'm not hugely familiar with Python, so not entirely sure what it provides. I'd be surprised if it didn't do what you need, though.

Since VRML is a text format, you'll want to use a language which makes parsing it simple. Haskell might actually not be a bad idea, though you probably didn't have that much learning in mind. Ruby comes with a parser generator (racc or something) too. Dunno what Python has.
Quote this message in a reply
Moderator
Posts: 683
Joined: 2002.11
Post: #5
Python, Ruby, and Java all do what you want. So does BlitzMax, but you probably don't want to bother with that. Also Perl.

My web site - Games, music, Python stuff
Quote this message in a reply
Moderator
Posts: 373
Joined: 2006.08
Post: #6
thanks for all of the info, everyone Smile
I've decided to attempt writing the program in Haskell, since OSC keeps recommending it in various posts around here, and I haven't learned a new language in several months Wink
From reading over some tutorials I found, the language looks.....tricky...to say the least, so you'll probably be seeing some posts asking for help on it Rasp

Again, thanks for the help guys.
-wyrmmage

Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Multiplayer, social and cross platform API Yespapa 0 1,492 Aug 14, 2013 02:43 AM
Last Post: Yespapa
  Cross platform library for http communication? Najdorf 2 4,062 Jan 11, 2009 01:13 PM
Last Post: Najdorf
  Cross-Platform IDE compatible w/ Scons wyrmmage 6 6,395 Mar 30, 2008 06:47 PM
Last Post: OneSadCookie
  cross-platform SDL packaging mac_girl 4 4,778 Mar 11, 2007 04:45 AM
Last Post: mac_girl
  Cross Platform SVN Nick 10 5,553 Mar 13, 2006 07:46 AM
Last Post: nalenb