Moto Hell - The Motorola Modding Community
April 29, 2024, 06:04:49 am *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: The forum is no longer active and registration is disabled; however you can still fetch everything as guest.
 
   Home   Help Facebook Search Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: [E2] File/Folder Chooser Script  (Read 4715 times)
BlinK_
Guest
« on: May 08, 2008, 01:50:17 pm »

Hello everyone. I present you my new script. Its only useful for developers. Here goes the description:
Quote
# File/Folder Chooser script by BlinK_
# 2008.06.12
#
# This script will let you to select any file or folder.
# It uses show* binaries for GUI. Big thanks to the creators.
#
# This script takes three parameters:
# 1. [o,l,f] Tells what do you want to select from.
#         o - folders
#         l - symbolic links
#         f - files
# 2. [Starting directory] No explanation needed (: .
# 3. [Message] Message which is displayed in title.
#
# This script will return full path to selected file/folder,
# or number zero if cancel pressed.
#
# for example.:
#      ./fileChooser.lin olf / "Select file/folder"
#      This will start script at / and will let you to select
#      folders, symbolic links and regular files.
#
#      ./fileChooser.lin o /home/ "Select folder"
#      This will start script at /home/ and will let you to select
#      only folders.
#
# When navigating, select ../ to go back one folder.
# Select ./ to select current folder. All the folders have
# following /, symlinks have following @, and regular files
# have following *.
#
# This script does NOT follow symbolic links. It treats them
# as regular files.
#
# Known bugs: does not work with files or folders which have
# spaces in names.
#
# Inspired by Keaglez Wall Changer application. This script is
# a MUST for it. (:
#
# Big thanks to everyone who contributed to E2 community.
# Use this script wherever you want. (: But leave this header.

EDIT: New Version. Only a bug fix.
« Last Edit: June 12, 2008, 10:22:11 am by BlinK_ » Logged
andrei
Guest
« Reply #1 on: May 08, 2008, 05:05:04 pm »

in *.lin? wow, superb bro...
Logged
keaglez
Indonesian Motolover
PHD modder
***

Karma: 61
Offline Offline

Posts: 2562


http://jeffri.net


View Profile WWW
« Reply #2 on: May 08, 2008, 11:45:29 pm »

Nice one... Grin Uhmm...but im sorry to say this...there is a showFileBrowse already which is written in C++ and its doing a similar thing like ur script does... Smiley Btw, maybe i can help with the whitespace there...
ADD:
Ah...expr...command not found... Sad I cant run this script properly... (am i miss this expr in my phone?) :'(
« Last Edit: May 09, 2008, 12:00:29 am by Herrick Tword » Logged

Best regards,
Jeffri H.

BlinK_
Guest
« Reply #3 on: May 09, 2008, 12:22:49 am »

Yea. I saw somewhere showFileBrowse binary. But since it wasnt in my phone, I wrote this script.

I just noticed that /bin/expr is just a sym link to busybox in my phone. Could you check if your busy box has expr? If so, I will fix the script to use busybox directly.

EDIT: if you have showFileBrowse binary, can you send it over? Or maybe you know where to find source?

« Last Edit: May 09, 2008, 12:24:58 am by BlinK_ » Logged
keaglez
Indonesian Motolover
PHD modder
***

Karma: 61
Offline Offline

Posts: 2562


http://jeffri.net


View Profile WWW
« Reply #4 on: May 09, 2008, 12:43:50 am »

ShowFileBrowse here... Ah...i got it now...busybox expr and sort...works... Hmm...btw it cant show files...
Quote
line 83: [: -gt: unary operator expected
Logged

Best regards,
Jeffri H.

error398
Guest
« Reply #5 on: May 09, 2008, 01:03:29 am »

its not my level Grin
Logged
BlinK_
Guest
« Reply #6 on: May 09, 2008, 01:19:40 am »

83rd line should look like this:
Quote
if [ $(busybox expr index ${fileTypes} f) -gt 0 ]; then

Does it look the same? If so, can you post what this command returns:
Quote
# busybox expr index ofl o
Logged
keaglez
Indonesian Motolover
PHD modder
***

Karma: 61
Offline Offline

Posts: 2562


http://jeffri.net


View Profile WWW
« Reply #7 on: May 09, 2008, 03:52:53 am »

Ah... Nvm... Its my mistake... XD it works well btw... Smiley
Logged

Best regards,
Jeffri H.

BlinK_
Guest
« Reply #8 on: May 09, 2008, 04:33:50 am »

Alright then. Uploaded fixed version at first post.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Design By Forum Hosting
Powered by SMF 1.1.21 | SMF © 2015, Simple Machines