Sponsored Content
Full Discussion: Linking Automation
Top Forums UNIX for Advanced & Expert Users Linking Automation Post 302852835 by Corona688 on Thursday 12th of September 2013 01:02:53 PM
Old 09-12-2013
Symbolic links cannot automagically create themselves. Something has to create them.

If all you want is the same folder in a different place, why not symbolically link the entire directory instead of its individual contents?

Code:
# Create an empty folder 'a'
$ mkdir a
# Create the empty file 'b' inside it
$ touch a/b
# 'newdir' is a symbolic link to 'a'
$ ln -s a newdir
# running ls on it shows a's contents
$ ls newdir

b

# If you create a new file in a, it shows up in newdir too
$ touch a/c
$ ls newdir

b
c

# If you create a new file in newdir, it shows up in a too
$ touch newdir/d
$ ls a

b
c
d

$

It's also possible to do something similar with mount tricks, but that's likey overkill.
 

9 More Discussions You Might Find Interesting

1. UNIX Desktop Questions & Answers

Linking Directories...

Hi there, I am very new to UNIX. Currently, I am running Mac OS X. I set up a FTP server on my computer so that I can transfer files back and forth between my computer at home and at work. All my data and files are located in a directory in another drive, but when I log in, I would be in my... (3 Replies)
Discussion started by: floppiless
3 Replies

2. Programming

Linking problem while linking to shared library

Hi I'm getting ld: fatal: option -h and building a dynamic executable are incompatible ld: fatal: Flags processing errors When I run ld -shared -L/usr/dt/lib -lDtSvc -o builtin.so Workspace.o after running gcc -fPIC -I/usr/X11R6/include -I/usr/dt/include -c Workspace.c I'm... (6 Replies)
Discussion started by: laho
6 Replies

3. Programming

Linking with gcc

Forgive as I am new to the gcc compiler and to linux. I am trying to compile/link a program for the first time and am receiving an error complaining about the crtbegin.o file. I use the -v option and get the following: Using built-in specs. Configured with: ../configure --enable-threads=posix... (1 Reply)
Discussion started by: jbeauchamp
1 Replies

4. Solaris

linking in solaris9

at the end of the compilation in solaris 9. it is showing link error. like..... ld: fatal: library -lgthread-2.0 not found failed to create the binary the library is in /usr/lib and in /usr/local/lib the lib file is present --->libgthread.2.0.so ......etc if i remove... (3 Replies)
Discussion started by: biswajithit
3 Replies

5. AIX

linking problem

hello, Is the code compiled under Visual Age C++ Broker (a third party library) - can be used to link against a code compiled from gcc compiler. I have a problem in building xerces in AIX Please reply. Regards, Parthasarathy (1 Reply)
Discussion started by: Parthasarathy
1 Replies

6. UNIX for Dummies Questions & Answers

is linking possible?

how would i link 2 files together? is it the same as copying? (1 Reply)
Discussion started by: trob
1 Replies

7. Solaris

g++ linking problem...

I use Solaris 10, compiling with a custom g++ (3.4.6) and GNU binutils (2.17). Things have gone well on two different systems, but when I tried moving to a third, it all fell over. Basically, it is now using the CC linker, but I need to use options not available to it. I believe I have found the... (0 Replies)
Discussion started by: Elric of Grans
0 Replies

8. Programming

Linking problem

Hi! We recently updated the server (server is a big word, it's really just a desktop with Ubuntu that we access with ssh) on which we compile our code. Since the update my code won't compile. The linker is complaining about missing references from almost all .so that I'm linking from. It... (0 Replies)
Discussion started by: philippevk
0 Replies

9. Programming

Linking .so into C program

I have a C binary file(.so as extension) which is delivered by a product. How do i use this functionalities of this .so file in my C program? How can in link the .so to my C program? (1 Reply)
Discussion started by: vkca
1 Replies
FileBrowser(3I) 					    InterViews Reference Manual 					   FileBrowser(3I)

NAME
FileBrowser - browse and/or select file names SYNOPSIS
#include <InterViews/filebrowser.h> DESCRIPTION
FileBrowser is a StringBrowser that displays file names. In addition to the standard StringBrowser constructor parameters, the FileBrowser constructor takes a directory name as an argument. The FileBrowser scans the corresponding directory, appending the file names to its list of strings. FileBrowser lets the user choose a file name, and the application queries the FileBrowser for the chosen file. PUBLIC OPERATIONS
FileBrowser(ButtonState*, const char* dir, int rows, int cols, boolean uniqueSel, int highlight, const char* done) FileBrowser(const char* name, ButtonState*, const char*, int, int, boolean, int, const char*) Create a new FileBrowser object. The ButtonState, rows, cols, uniqueSel, highlight, done, and name parameters have semantics iden- tical to those of the corresponding StringBrowser parameters. The dir parameter specifies the directory to search for file names. Internally, FileBrowser prepends dir to relative path specifications in operations that require them, thus avoiding a chdir(2). boolean IsADirectory(const char*) Return whether or not the given relative path corresponds to a valid directory. boolean SetDirectory(const char* newdir) Change the search directory to newdir if that directory is accessible. The function returns true if successful. const char* GetDirectory() Return the name of the search directory. const char* ValidDirectories(const char* path) Given a path string, return the largest substring (starting from the beginning of path) that represents a valid path. The substring is returned in a static buffer and should be copied before use. const char* Normalize(const char* path) Return a normalized version of path with all spurious slashes, dots, and tildes interpreted. The normalized path is returned in a static buffer and should be copied before use. const char* Path(int i) Return the ith string as it appears in the FileBrowser. This function prepends the search directory to the string, normalizes the concatenation, and returns the result. void RereadDirectory() Rescan the current directory without updating the FileBrowser's appearance. virtual void Update() Rescan the current directory and update the FileBrowser's appearance to reflect any changes in the set of files it should display. void SetTextFilter(const char*) void SetDirectoryTextFilter(const char*) void SetModeFilter(int) void SetDirectoryModeFilter(int) By default, FileBrowser displays all the files and directories it finds in the search directory. These functions provide some con- trol over the entries that FileBrowser displays. SetTextFilter specifies a regular expression (see Regexp(3I)) to match against file names. SetDirectoryTextFilter serves a similar role for directory names. SetModeFilter and SetDirectoryModeFilter specify the mode (see chmod(1)) that displayed files and directories should have. Only files and directories that match both the regular expression and the mode will appear in the FileBrowser. Passing nil for the regular expression or 0 for the mode restores the default behavior. PROTECTED OPERATIONS
void UpdateStrings() Explicitly update the FileBrowser's appearance to reflect any changes in the set of files it should display without rescanning the directory. virtual boolean Acceptable(const char*) Return whether the given file name is an acceptable name. By default, files that conform to the text or mode filter specifications are acceptable. Only acceptable files will be displayed by UpdateStrings. SEE ALSO
Interactor(2I), Button(3I), StringBrowser(3I), Regexp(3I), chmod(1) InterViews 30 November 1989 FileBrowser(3I)
All times are GMT -4. The time now is 10:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy