saf extractor

Post anything about MX Simulator here. Please. I'm begging you.
WellsMX524
Posts: 1900
Joined: Sun Feb 05, 2012 7:23 am
Team: MV Films
Location: Illinois

Re: saf extractor

Postby WellsMX524 » Tue Oct 08, 2013 1:31 am

MX PRODIGY 17 wrote:It's funny cause it's JLV

User avatar
gd1911
Crushed Dissenter
Posts: 153
Joined: Tue Sep 24, 2013 7:30 pm

Re: saf extractor

Postby gd1911 » Tue Oct 08, 2013 2:15 am

jlv wrote:Here you go:

Code: Select all

#!/bin/bash
#
# Simple Archive Format
#


#set -C

if test "_$1_" = _c_
then
   shift
   find "$@" -maxdepth 0 -printf '%s %p\n'
   echo -
   cat "$@"
elif test "_$1_" = _x_
then
   shift
   count=0

   while read size name && test "_${size##[^0-9]}_" = "_${size}_"
   do
      sizes[count]=$((size))
      names[count]=${name}
      count=$((count+1))
   done

   if test "_${size}_" != "_-_"
   then
      echo "Bad dir"
      exit
   fi

   i=0
   while let 'i<count'
   do
      echo ${names[i]} ${sizes[i]}
      if test "_${names[i]##*/}_" != "_${names[i]}_"
      then
         install -d "${names[i]%/*}"
      fi
      dd bs=${sizes[i]} count=1 >"${names[i]}" 2>/dev/null
      i=$((i+1))
   done

else
   echo "To create an archive use: saf.sf c files..."
   echo "To extract an archive use: saf.sf x"
fi


Image
I am not designed to come second or third. I am designed to win. - Ayrton Senna

User avatar
wheels1758
Posts: 4130
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: saf extractor

Postby wheels1758 » Sun Oct 13, 2013 4:50 pm

jlv wrote:If you don't use Linux then FU!

isacult
Posts: 305
Joined: Sun May 27, 2012 10:34 pm
Team: BakerMX.com
Location: Charlotte, NC
Contact:

Re: saf extractor

Postby isacult » Fri Jun 06, 2014 7:32 pm

wheels1758 wrote:
jlv wrote:If you don't use Linux then FU!


Ooooh no Unix love.. just Linux..?
It is possible to run this in windows, with cygwin.

jlv I am jealous of your bash knowledge.
Justin Baker | BakerMX.com #51
Image
AWood wrote:WOOO BAKER

AWood wrote:Your excuses are about as shitty as mike Alessi on pulp MX show

jlv
Site Admin
Posts: 13135
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: saf extractor

Postby jlv » Sat Jun 07, 2014 2:41 am

There might be some line ending issues in Cygwin. If there's a way to force it to binary mode it should work fine.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.

ty casey
Posts: 390
Joined: Tue Jul 30, 2013 7:29 pm
Team: OGP Racing

Re: saf extractor

Postby ty casey » Thu Mar 03, 2016 2:25 am

someone shoot me a link.
https://www.youtube.com/user/TC132MX
^^Subcribe to my channel^^
Image

User avatar
byrd55621
Crushed Dissenter
Posts: 525
Joined: Sat Mar 07, 2015 6:41 pm
Team: Quality designs
Location: ohio
Contact:

Re: saf extractor

Postby byrd55621 » Thu Mar 03, 2016 5:00 pm

Just search puremxs saf extracter
Do skins cheap!!!!
If you enjoy my content please donate https://www.paypal.me/ByrdGreen
Feel free to visit my facebook: https://www.facebook.com/556Designs/

User avatar
Wahlamt
Posts: 7038
Joined: Mon Sep 13, 2010 3:15 pm
Team: MLG Compton
Location: Sweden
Contact:

Re: saf extractor

Postby Wahlamt » Thu Mar 03, 2016 5:49 pm

ty casey wrote:someone shoot me a link.

You have the code on page 1, why would you need a link?

ty casey
Posts: 390
Joined: Tue Jul 30, 2013 7:29 pm
Team: OGP Racing

Re: saf extractor

Postby ty casey » Thu Mar 03, 2016 6:55 pm

how do i use it
https://www.youtube.com/user/TC132MX
^^Subcribe to my channel^^
Image

ty casey
Posts: 390
Joined: Tue Jul 30, 2013 7:29 pm
Team: OGP Racing

Re: saf extractor

Postby ty casey » Thu Mar 03, 2016 6:59 pm

do i just turn that into a .exe?
https://www.youtube.com/user/TC132MX
^^Subcribe to my channel^^
Image

User avatar
Wahlamt
Posts: 7038
Joined: Mon Sep 13, 2010 3:15 pm
Team: MLG Compton
Location: Sweden
Contact:

Re: saf extractor

Postby Wahlamt » Thu Mar 03, 2016 8:12 pm

Make it a shell script that you run.

User avatar
Wahlamt
Posts: 7038
Joined: Mon Sep 13, 2010 3:15 pm
Team: MLG Compton
Location: Sweden
Contact:

Re: saf extractor

Postby Wahlamt » Sat Jun 11, 2016 10:06 pm

jlv wrote:Here you go:

Code: Select all

#!/bin/bash
#
# Simple Archive Format
#


#set -C

if test "_$1_" = _c_
then
   shift
   find "$@" -maxdepth 0 -printf '%s %p\n'
   echo -
   cat "$@"
elif test "_$1_" = _x_
then
   shift
   count=0

   while read size name && test "_${size##[^0-9]}_" = "_${size}_"
   do
      sizes[count]=$((size))
      names[count]=${name}
      count=$((count+1))
   done

   if test "_${size}_" != "_-_"
   then
      echo "Bad dir"
      exit
   fi

   i=0
   while let 'i<count'
   do
      echo ${names[i]} ${sizes[i]}
      if test "_${names[i]##*/}_" != "_${names[i]}_"
      then
         install -d "${names[i]%/*}"
      fi
      dd bs=${sizes[i]} count=1 >"${names[i]}" 2>/dev/null
      i=$((i+1))
   done

else
   echo "To create an archive use: saf.sf c files..."
   echo "To extract an archive use: saf.sf x"
fi

Sitting here doing this for fun. For some reason when I try to open an older .saf archive (from the old "needed object packs") I get the error message "Bad Dir" after trying:
./saf.sf x
NewTreespack.saf

Saf.sf is the script and NewTreespack.saf is what I am trying to open... Any clues?

jlv
Site Admin
Posts: 13135
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: saf extractor

Postby jlv » Sun Jun 12, 2016 1:58 am

You have to redirect the saf as the standard input:

./saf.sf x <NewTreespack.saf

Without the redirect op < it should have just hung waiting for input until you pressed ctrl-c or ctrl-d.
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.

User avatar
Wahlamt
Posts: 7038
Joined: Mon Sep 13, 2010 3:15 pm
Team: MLG Compton
Location: Sweden
Contact:

Re: saf extractor

Postby Wahlamt » Mon Jun 13, 2016 8:15 am

jlv wrote:You have to redirect the saf as the standard input:

./saf.sf x <NewTreespack.saf

Without the redirect op < it should have just hung waiting for input until you pressed ctrl-c or ctrl-d.

Thanks! That worked. I though the new line after "./saf.sf x" was enough to insert "NewTreespack.saf" on, but apparently it wasn't. Thanks again!

Edo
Posts: 12
Joined: Mon Jan 28, 2019 1:26 pm
Team: Privateer

Re: saf extractor

Postby Edo » Wed Jan 30, 2019 6:21 pm

sorry, can anyone explain me how should i run it? i really can't get it :(


Return to “General Discussion”

Who is online

Users browsing this forum: Bing [Bot], christianjonse and 7 guests