[SOLVED] Most library minimal Norton Command like applications?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Most library minimal Norton Command like applications?
Hello,
I am looking for a very portable, tiny, Norton Command like applications (opensource). I am just beginning C coding.
Of course, it is nice to have a file browser under the terminal/console.
Sometimes, there isn't ncurses devel, nor libtinfo.so.5, on the BSD/Linux/Solaris/... system. It may be useful, comfortable, to have an alternative the Midnight Commander, based on C, which could be easily compiled. Don't you think?
For years (decades... ) mc has been my go-to tool for CLI file management... And I'm utterly disappointed that it is not stand-alone and that it is quite bulky for an application of it's type, and has too many dependencies.
This looks very promising, Xeratul. Colour me impressed.
Please keep up the good work!
P.S. It didn't compile for me under Slackware 14.2:
Code:
rob@slacktop:~/Downloads/mnc$ gcc -o mnc mnc.c
mnc.c: In function 'compare_fun':
mnc.c:7:9: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
cmp = strcmp( l, r );
^
mnc.c: In function 'main':
mnc.c:18:15: error: 'PATH_MAX' undeclared (first use in this function)
char line[PATH_MAX];
^
mnc.c:18:15: note: each undeclared identifier is reported only once for each function it appears in
mnc.c:24:5: warning: implicit declaration of function 'strncpy' [-Wimplicit-function-declaration]
strncpy( currentselection, "", PATH_MAX );
^
mnc.c:24:5: warning: incompatible implicit declaration of built-in function 'strncpy'
mnc.c:24:5: note: include '<string.h>' or provide a declaration of 'strncpy'
mnc.c:28:5: error: unknown type name 'DIR'
DIR *dirp;
^
mnc.c: In function 'loaddir':
mnc.c:35:12: warning: implicit declaration of function 'opendir' [-Wimplicit-function-declaration]
dirp = opendir( "." );
^
mnc.c:35:10: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
dirp = opendir( "." );
^
mnc.c:36:19: warning: implicit declaration of function 'readdir' [-Wimplicit-function-declaration]
while ((dp = readdir( dirp )) != NULL &&
^
mnc.c:36:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
while ((dp = readdir( dirp )) != NULL &&
^
mnc.c:38:28: error: dereferencing pointer to incomplete type 'struct dirent'
if ( strcmp( dp->d_name , "." ) != 0 )
^
mnc.c:46:5: warning: implicit declaration of function 'closedir' [-Wimplicit-function-declaration]
closedir( dirp );
^
mnc.c:49:7: warning: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
qsort( idata, n , sizeof idata[0], compare_fun );
^
mnc.c: In function 'drawit':
mnc.c:75:16: warning: implicit declaration of function 'fexist' [-Wimplicit-function-declaration]
if ( fexist( idata[ n ] ) == 2 )
^
mnc.c: In function 'mncview':
mnc.c:107:51: warning: implicit declaration of function 'strrlf' [-Wimplicit-function-declaration]
mvprintw( posy - mncview_scrolly , 0, "%s", strrlf( line ));
^
mnc.c: In function 'main':
mnc.c:212:21: warning: implicit declaration of function 'chdir' [-Wimplicit-function-declaration]
chdir( getenv( "HOME" ) );
^
mnc.c:212:28: warning: implicit declaration of function 'getenv' [-Wimplicit-function-declaration]
chdir( getenv( "HOME" ) );
^
rob@slacktop:~/Downloads/mnc$
For years (decades... ) mc has been my go-to tool for CLI file management... And I'm utterly disappointed that it is not stand-alone and that it is quite bulky for an application of it's type, and has too many dependencies.
This looks very promising, Xeratul. Colour me impressed.
Please keep up the good work!
P.S. It didn't compile for me under Slackware 14.2:
Code:
rob@slacktop:~/Downloads/mnc$ gcc -o mnc mnc.c
mnc.c: In function 'compare_fun':
mnc.c:7:9: warning: implicit declaration of function 'strcmp' [-Wimplicit-function-declaration]
cmp = strcmp( l, r );
^
mnc.c: In function 'main':
mnc.c:18:15: error: 'PATH_MAX' undeclared (first use in this function)
char line[PATH_MAX];
^
mnc.c:18:15: note: each undeclared identifier is reported only once for each function it appears in
mnc.c:24:5: warning: implicit declaration of function 'strncpy' [-Wimplicit-function-declaration]
strncpy( currentselection, "", PATH_MAX );
^
mnc.c:24:5: warning: incompatible implicit declaration of built-in function 'strncpy'
mnc.c:24:5: note: include '<string.h>' or provide a declaration of 'strncpy'
mnc.c:28:5: error: unknown type name 'DIR'
DIR *dirp;
^
mnc.c: In function 'loaddir':
mnc.c:35:12: warning: implicit declaration of function 'opendir' [-Wimplicit-function-declaration]
dirp = opendir( "." );
^
mnc.c:35:10: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
dirp = opendir( "." );
^
mnc.c:36:19: warning: implicit declaration of function 'readdir' [-Wimplicit-function-declaration]
while ((dp = readdir( dirp )) != NULL &&
^
mnc.c:36:17: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
while ((dp = readdir( dirp )) != NULL &&
^
mnc.c:38:28: error: dereferencing pointer to incomplete type 'struct dirent'
if ( strcmp( dp->d_name , "." ) != 0 )
^
mnc.c:46:5: warning: implicit declaration of function 'closedir' [-Wimplicit-function-declaration]
closedir( dirp );
^
mnc.c:49:7: warning: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
qsort( idata, n , sizeof idata[0], compare_fun );
^
mnc.c: In function 'drawit':
mnc.c:75:16: warning: implicit declaration of function 'fexist' [-Wimplicit-function-declaration]
if ( fexist( idata[ n ] ) == 2 )
^
mnc.c: In function 'mncview':
mnc.c:107:51: warning: implicit declaration of function 'strrlf' [-Wimplicit-function-declaration]
mvprintw( posy - mncview_scrolly , 0, "%s", strrlf( line ));
^
mnc.c: In function 'main':
mnc.c:212:21: warning: implicit declaration of function 'chdir' [-Wimplicit-function-declaration]
chdir( getenv( "HOME" ) );
^
mnc.c:212:28: warning: implicit declaration of function 'getenv' [-Wimplicit-function-declaration]
chdir( getenv( "HOME" ) );
^
rob@slacktop:~/Downloads/mnc$
I think that some libraries could be added before.
That helped, but something else is missing as well:
Code:
rob@slacktop:~/Downloads/mnc/tiny-mnc-master$ gcc -o mnc mnc.c
mnc.c: In function 'mncview':
mnc.c:134:51: warning: implicit declaration of function 'strrlf' [-Wimplicit-function-declaration]
mvprintw( posy - mncview_scrolly , 0, "%s", strrlf( line ));
^
/tmp/cc8Ufqt6.o: In function `main':
mnc.c:(.text+0x1ef): undefined reference to `initscr'
mnc.c:(.text+0x1f9): undefined reference to `curs_set'
mnc.c:(.text+0x200): undefined reference to `stdscr'
mnc.c:(.text+0x20c): undefined reference to `stdscr'
mnc.c:(.text+0x228): undefined reference to `stdscr'
mnc.c:(.text+0x234): undefined reference to `stdscr'
mnc.c:(.text+0x2ae): undefined reference to `stdscr'
mnc.c:(.text+0x2c0): undefined reference to `wattr_on'
mnc.c:(.text+0x2e5): undefined reference to `stdscr'
mnc.c:(.text+0x2ef): undefined reference to `wmove'
mnc.c:(.text+0x2fb): undefined reference to `stdscr'
mnc.c:(.text+0x308): undefined reference to `waddch'
mnc.c:(.text+0x348): undefined reference to `stdscr'
mnc.c:(.text+0x355): undefined reference to `wmove'
mnc.c:(.text+0x361): undefined reference to `stdscr'
mnc.c:(.text+0x36e): undefined reference to `waddch'
mnc.c:(.text+0x3b1): undefined reference to `mvprintw'
mnc.c:(.text+0x3d0): undefined reference to `mvprintw'
mnc.c:(.text+0x3d7): undefined reference to `stdscr'
mnc.c:(.text+0x3e9): undefined reference to `wattr_off'
mnc.c:(.text+0x3f0): undefined reference to `stdscr'
mnc.c:(.text+0x3f8): undefined reference to `wrefresh'
mnc.c:(.text+0x3ff): undefined reference to `stdscr'
mnc.c:(.text+0x407): undefined reference to `wgetch'
mnc.c:(.text+0x4ca): undefined reference to `mvprintw'
mnc.c:(.text+0x4d1): undefined reference to `stdscr'
mnc.c:(.text+0x4d9): undefined reference to `wrefresh'
mnc.c:(.text+0x4e0): undefined reference to `stdscr'
mnc.c:(.text+0x4e8): undefined reference to `wgetch'
mnc.c:(.text+0x53b): undefined reference to `mvprintw'
mnc.c:(.text+0x542): undefined reference to `stdscr'
mnc.c:(.text+0x54a): undefined reference to `wrefresh'
mnc.c:(.text+0x551): undefined reference to `stdscr'
mnc.c:(.text+0x559): undefined reference to `wgetch'
mnc.c:(.text+0x659): undefined reference to `stdscr'
mnc.c:(.text+0x665): undefined reference to `stdscr'
mnc.c:(.text+0x681): undefined reference to `stdscr'
mnc.c:(.text+0x68d): undefined reference to `stdscr'
mnc.c:(.text+0x71a): undefined reference to `curs_set'
mnc.c:(.text+0x71f): undefined reference to `endwin'
/tmp/cc8Ufqt6.o: In function `drawit.5076':
mnc.c:(.text+0x73d): undefined reference to `stdscr'
mnc.c:(.text+0x74f): undefined reference to `wattr_off'
mnc.c:(.text+0x756): undefined reference to `stdscr'
mnc.c:(.text+0x75e): undefined reference to `werase'
mnc.c:(.text+0x7b6): undefined reference to `mvprintw'
mnc.c:(.text+0x7c9): undefined reference to `stdscr'
mnc.c:(.text+0x7db): undefined reference to `wattr_on'
mnc.c:(.text+0x872): undefined reference to `mvprintw'
mnc.c:(.text+0x8a9): undefined reference to `mvprintw'
mnc.c:(.text+0x8b4): undefined reference to `stdscr'
mnc.c:(.text+0x8c6): undefined reference to `wattr_off'
/tmp/cc8Ufqt6.o: In function `mncview.5083':
mnc.c:(.text+0x92e): undefined reference to `stdscr'
mnc.c:(.text+0x940): undefined reference to `wattr_off'
mnc.c:(.text+0x947): undefined reference to `stdscr'
mnc.c:(.text+0x94f): undefined reference to `werase'
mnc.c:(.text+0x9a3): undefined reference to `strrlf'
mnc.c:(.text+0x9c3): undefined reference to `mvprintw'
mnc.c:(.text+0x9f5): undefined reference to `stdscr'
mnc.c:(.text+0xa07): undefined reference to `wattr_on'
mnc.c:(.text+0xa23): undefined reference to `stdscr'
mnc.c:(.text+0xa2d): undefined reference to `wmove'
mnc.c:(.text+0xa39): undefined reference to `stdscr'
mnc.c:(.text+0xa46): undefined reference to `waddch'
mnc.c:(.text+0xa84): undefined reference to `mvprintw'
mnc.c:(.text+0xa8b): undefined reference to `stdscr'
mnc.c:(.text+0xa93): undefined reference to `wgetch'
mnc.c:(.text+0xae7): undefined reference to `stdscr'
mnc.c:(.text+0xaf9): undefined reference to `wattr_off'
collect2: error: ld returned 1 exit status
rob@slacktop:~/Downloads/mnc/tiny-mnc-master$
rob@slacktop:~/Downloads/mnc/tiny-mnc-master$ gcc mnc.c -o mnc -lm -lncurses
mnc.c: In function 'mncview':
mnc.c:134:51: warning: implicit declaration of function 'strrlf' [-Wimplicit-function-declaration]
mvprintw( posy - mncview_scrolly , 0, "%s", strrlf( line ));
^
/tmp/cctrjoDg.o: In function `mncview.5083':
mnc.c:(.text+0x9a3): undefined reference to `strrlf'
collect2: error: ld returned 1 exit status
rob@slacktop:~/Downloads/mnc/tiny-mnc-master$
Quote:
Originally Posted by Xeratul
with before:
Code:
apt-get install ncurses5-dev
here "-dev" means devel for compiling.
I'm doing this on Slackware, which includes the dynamic libraries in every package.
rob@slacktop:~/Downloads/mnc/tiny-mnc-master$ gcc mnc.c -o mnc -lm -lncurses
mnc.c: In function 'mncview':
mnc.c:134:51: warning: implicit declaration of function 'strrlf' [-Wimplicit-function-declaration]
mvprintw( posy - mncview_scrolly , 0, "%s", strrlf( line ));
^
/tmp/cctrjoDg.o: In function `mncview.5083':
mnc.c:(.text+0x9a3): undefined reference to `strrlf'
collect2: error: ld returned 1 exit status
rob@slacktop:~/Downloads/mnc/tiny-mnc-master$
I'm doing this on Slackware, which includes the dynamic libraries in every package.
Does mnc need the static library?
it does not need libs, just ncurses-dev
strrlf is to remove the LF. You can just remove it into the src code if you want to make the code work'.
It compiled without needing anything extra, apart from the tweaks above.
I'd be happy to contribute wherever I can.
you can make a project or fork of this tiny browser. it can greatly help people who have hands on a ssh, and that have nothing installed. This tiny broweser is great when no single libraries are installed, just gcc and fews.
this app is of great help when you have on a distant ssh new server.
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,487
Rep:
Interesting project, looks like a cross between mc & vifm.
I used to have mc-light on one of my distros a while ago, but they stopped development of it.
File manager & editor combined with a compressed file extracter, basically, from memory.
Interesting project, looks like a cross between mc & vifm.
I used to have mc-light on one of my distros a while ago, but they stopped development of it.
File manager & editor combined with a compressed file extracter, basically, from memory.
you can use "nc", it is much better You can test it...
It's free (=0$$).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.