Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 16 Apr 2014, 08:12
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
gfnrename-0.6 hacked...
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [1 Post]  
Author Message
plinej

Joined: 13 Aug 2006
Posts: 1522

PostPosted: Fri 13 Jul 2012, 20:43    Post subject:  gfnrename-0.6 hacked...
Subject description: batch file renaming tool
 

One thing I never liked about gfnrename is that it always starts in your home directory then you have to navigate to the directory you want to rename files in. I finally decided to see if I could hack the source code and it was easy enough to just add a line in callbacks.c.

Just before:
Code:
if(!strlen(Gbl->SrcDir))  strcpy(Gbl->SrcDir, Gbl->HomeDir);


I added the line:
Code:
sprintf(Gbl->SrcDir, "%s/", getenv("PWD"));


Now starting gfnrename from the command line it will open in the current directory. I'm sure there is a way to hack the code to add a directory as an argument so it will open in that specified directory but that is above my head as far as c code goes. It's easy enough to create a bash script and name it gfnrenameshell (or whatever you'd like) and run it from the command line using a directory as an argument. The script would be as simple as:

Code:
#!/bin/sh

if [ -d "$1" ]; then
   cd "$1"
fi

gfnrename &


It would be nice to have the code right in the program though. Incase anyone is interested I'll post the hacked gfnrename binary compiled in Racy 5.3 and the hacked source code.
gfnrename.zip
Description  hacked binary, compiled in Racy 5.3
zip

 Download 
Filename  gfnrename.zip 
Filesize  84.27 KB 
Downloaded  196 Time(s) 
gfnrename-0.6-hacked.tar.bz2
Description  source code
bz2

 Download 
Filename  gfnrename-0.6-hacked.tar.bz2 
Filesize  454.13 KB 
Downloaded  188 Time(s) 

_________________
An archive of quite a few pet packages, mostly that I've compiled, is located at http://my.opera.com/jpline/blog
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [1 Post]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Filesystem
Jump to:  

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
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0442s ][ Queries: 13 (0.0050s) ][ GZIP on ]