LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-14-2011, 10:50 AM   #16
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721

Quote:
Originally Posted by ssrameez View Post
Technically Yes.. It will work. But everytime the user should create a symlink to the file if the file name is changing..
Why would it change?

Quote:
Originally Posted by ssrameez View Post
If the file name is not changing, why don't the program directly process the file, instead of accepting it as an input or getting the contents from it using a redirection. ?
That's beyond the OP's control. Read the original post more carefully.
 
Old 06-14-2011, 10:51 AM   #17
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Rep: Reputation: 8
you can try creating a symbolic link of the reqd file in the current directory. In order to do that just simply do this

Code:
# ln -s /data/data.txt data.txt
Then run your code.
 
Old 06-14-2011, 10:54 AM   #18
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721Reputation: 721
Quote:
Originally Posted by Genocide_Hoax View Post
you can try creating a symbolic link of the reqd file in the current directory. In order to do that just simply do this

Code:
# ln -s /data/data.txt data.txt
Then run your code.
I already mentioned that. Also, the paths you used are wrong (especially the "/" in front of the first parameter) and the OP might get confused if he is not familiar with the way ln works.

EDIT:

One unrelated thing that I want to mention about ln -s that always confused me until I got it is that the target should be specified relative to the link, NOT the current directory!

This actually makes sense, since the link itself doesn't know about the current directory you used when making it, the path it stores is treated as relative to the symlink itself.

Last edited by MTK358; 06-14-2011 at 11:00 AM.
 
Old 06-15-2011, 04:35 AM   #19
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Rep: Reputation: 8
Yes Sorry I didn't read the entire thread before I posting. My apologies.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a .txt file in a specified directory.... msr4 Linux - Newbie 16 04-26-2011 03:02 PM
compare directory to .txt or .xml??? aircftech Programming 9 12-15-2010 01:14 PM
[SOLVED] How upload a txt file to a domain's base directory? JuJamEI Linux - Newbie 1 11-16-2010 01:17 PM
How do you add a .txt file to a domains base directory Trebore General 2 10-14-2009 03:47 PM
Bash, how do I test for *.txt files in a directory with IF? severian23 Programming 7 11-04-2004 10:47 AM


All times are GMT -5. The time now is 08:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration