Programming :: Can I Get Absolute Path Without Giving A "path" But Inode Number By C

Aug 13, 2010

Does anyone know how to get the path with a inode number by C programming?
Or can I get the absolute path without giving a "path" but a inode number by C?

like this: get_path(unsigned inode);
not such this function: getcwd(".", xxx);
taowuwen@gmail.com

View 7 Replies


ADVERTISEMENT

Programming :: Java Applet Not Loading Image With Relative Path But With Absolute Path / Resolve It?

Jul 17, 2009

Java applet not loading image with relative path(e.g. images/1.jpg) but loads image with absolute path(i.e. from /root/user/images/1.jpg) . This is a problem when i want to host the applet on web server

View 2 Replies View Related

General :: Forcing An Absolute Path Where A Relative Path Is Expected

Feb 21, 2011

I have a program that takes a relative path as input appends it to a some path string to get the actual path.

Now all I can input is the relative path. So if I want to go one level above my input will be ../mypath.

If I know the depth of the path used internally, I can use .. as many times to go to the root directory and then give the absolute path. But suppose I do not know the depth of the directory, can I construct a relative path string such that it considers it as a relative path. One way could be to have enough .. in the path string so that I can force an absolute path for some maximum depth of path.

Is there some path string syntax that I am not aware of but can achieve this?

View 2 Replies View Related

General :: Change Absolute Path To Relative Path?

May 31, 2011

Current script:-

prefix=user@my-server:
find . -depth -type d -name .git -printf '%h�' | while read -d "" path ; do (
cd "$path" || exit $?

[code]....

How shall i go about changing the absolute path to relative path, so that /home/git/mirror/android/adb/ndk.git gets converted to /mirror/android/adb/ndk.git //echo <command> "$prefix$PWD.git" ?? - anything for relative path?

View 7 Replies View Related

Programming :: Reading The Absolute File-path As Sorted?

Jun 13, 2010

I wanted to read out the absolute file-path (filename) as sorted in a folder (on Linux). The reading the file-paths is ok but I have problems in sorting.

Code:

selectedDirectory = fl_dir_chooser ("Select Imagedirectory:",NULL,0); //This is just a widget to show the folder.
DIR *d;
dirent *de;

[code]....

The files -105.dcm, -106.dcm, -107.dcm lie in the folder at the bottom and -36.dcm, -37.dcm- at the top. The program compares 1 and 3 of 105 and 37, 1 is lesser than 3, then prints out first, but does not know that 105 is three digits and 37 is two digits.

View 1 Replies View Related

General :: Command Line - Get Relative Path From Two Absolute Paths In Shell?

May 13, 2010

We have two paths. First one is directory, second either dir or file.

/a/b/c and /a/d/e.txt

Relative path from first path to second will be: ../../d/e.txt

How to get it in linux terminal?

PS: For those who ask "what is use case?" - creating lots of relative symlinks (just as an example)

View 1 Replies View Related

General :: Difference Between PATH=$PATH:$1 & PATH=$1:$PATH?

Jan 16, 2011

I found the following function in /etc/profile file.

[Code]...

1. I dont undestand what "if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)"" this if statement actually comapres??

2. Also what is the difference between PATH=$PATH:$1 & PATH=$1:$PATH

View 14 Replies View Related

General :: Move A File To Some Path And Create That Path When It Doesn't Exist?

Oct 8, 2010

I use this command:

Code:

find ./ -atime +360

to figure out the files that haven't been accessed since 360 days. The command above will return results like this:

Code:

/uploads/2010/02/some-file-name.ext
/uploads/2009/08/another-file-name.ext
... etc

I'm taking here about tins of directories, thousands of files. I'm looking to find a command that makes me able to move the results above to another path, and to create that path once it doesn't exist like below:

Code:

mv /uploads/2010/02/some-file-name.ext /old-files/uploads/2010/02/some-file-name.ext

But I want the executed command to create this path

Code:

/old-files/uploads/2010/02/

If it doesn't exist.

View 6 Replies View Related

General :: Deleted Path Variable - How To Return To The Original Path Value

Apr 26, 2011

Experimenting with shell variables, accidentally deleted the path variable how could I return to the original path value. What kinds of problems will I have if I don't have a path variable.

View 3 Replies View Related

General :: Extract Only Number In A Path In Bash?

Mar 17, 2011

I've these path:

Code:
xxx/yyy/zzz/0908/aaa/a.txt
xxx/yyy/zzz/0909/aaa/a.txt
xxx/yyy/zzz/0910/aaa/a.txt
fff/ggg/hhh/iii/jjj/0911/aaa/a.txt
fff/ggg/hhh/kkk/0912/aaa/a.txt

and I would like to extract only the number, so that I've get the result

Code:
0908
0909
0910
0911
0911

How can I do it in bash?

View 1 Replies View Related

Red Hat / Fedora :: Appending A Path To PATH Variable Permanently?

Oct 21, 2010

how to add a path to PATH variable permanently so that it remains persisent even after closing shell and rebooting the system when i added a path, to variable it remained there as long as i didn't closed the shell. but when i reopened it ,changed were undone.

View 2 Replies View Related

General :: Change Windows Path To Unix Path?

Sep 14, 2009

I have a path c:windowsackup I need this string to be changed into /windows/back/up I used the command -bash-3.00$ echo windackup | sed 's/\//g' but the output is windbackup

View 7 Replies View Related

Programming :: Finding A Number In Windows Like The Inode

Aug 19, 2010

anyone know that the ntfs's file sytem struct? is there's a API or something other could let me get this number? Or there is actually no such number in windows like the number of inode in linux?

View 1 Replies View Related

SUSE / Novell :: Add Path To $PATH Variable?

Apr 19, 2009

I am trying to figure out how i can add the path /usr/sbin/ into the $PATH variable. I want this to be used from the normal account. I am bored settinh this manualy each time my computer starts.

View 2 Replies View Related

Fedora :: Add Path In .bashrc By Commenting Out Old Path And Adding New One - Command Source ~/bashrc

Jun 14, 2011

When I add some path in .bashrc by commenting out old path and adding new one like this:

#EXPORT HOME_PLAY=/home/gem/old_play
EXPORT HOME_PLAY=/home/gem/play
EXPORT PATH=$PATH:HOME_PLAY

After saving above changes, I enter the command: source ~/.bashrc Now if I do echo $PATH, the path shows both the old PLAY_HOME and new PLAY_HOME. This is really bad and messes up a lot of things in my project. This problem only goes away if I logout or reboot, a rather very long process. What is happening is that the old path is added to new path element and the old path includes the old path element you want to remove.

View 10 Replies View Related

Fedora :: 12 And VMTools - The Path "" Is Not Valid Path To The Gcc Binary

Mar 23, 2010

running Windows 7 64bit with VMware Workstation 7.01-build 227600. I have some knowledge of Linux, I have installed f12 and have updated the system as of 03/22/2010. All updates completed successfully.

1) How do I install VMTools on the f12 (after mounting the CD/DVD tool package)

2) How do I update the gcc files it says are dependencies?

Here's what I get on installation:Before you can compile modules, you need to have the following installed...

make
gcc
kernel headers of the running kernel

and then I am prompted for this input from the install script:

Searching for GCC...
The path "" is not valid path to the gcc binary.
Would you like to change it? [yes]

and this is where I get stuck. How do I get around this or satisfy the requirements for the install?

View 5 Replies View Related

General :: Command Path Is In PATH But Bash Does Not Find The Command

Jul 12, 2011

kernel 2.6.21.5, slackware 12.0
GNU bash 3.1.17

Code:

As you can see, /usr/local/bin is in the path. However, bash does not look for nasm in /usr/local/bin.

If I am root, things go well:

Code:

View 16 Replies View Related

Programming :: Add Path To Flenames ?

Feb 19, 2011

I have thousands files in thousands subfolders. All subfolders are named differently, but all files named like:

I have to replace "AAA_000" with the path of the file.

For example if I have a file AAA_000_001.tif in Foled/sub1/sub2, I have to rename AAA_000_001.tif to Foled/sub1/sub2_001.tif (or Folder_sub1_sub2_001.tif)

So far I have this script:

It can replace all AAA of all files in all subfolders with BBB, but I did not find a way to replace it with the path.

View 6 Replies View Related

Programming :: Specifying A File Path In IDL?

Jul 19, 2010

I've been dabbling in IDL lately, and it seems useful enough, but occasionally I come across a problem like this: I'm trying to call an IDL procedure from within an IDL script which is called from a .csh script. (Don't ask, trust me, you don't want to know.) The IDL procedure may or may not be in the same directory as the .csh, so I'm calling it by it's full path: /home/ic/rad_sim However, all IDL will do is give me a syntax error and tell me ic is an undefined variable. Putting ic in double quotes makes the undefined variable error go away, but it still reports a syntax error.

View 13 Replies View Related

Programming :: Add Folder To Perl Path?

Jun 8, 2010

I'm the server guy which is why I don't know this, but were staging a new webserver and we use some custom perl scripts and as were moving the site over for testing, apache is blowing a perl error;Can't locate web.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.0 /usr/local/share/perl/5.10.0 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at /home/mcp/htdocs/cgi-bin/newgraph.gif line 11.,Now I can copy that file local, but there are a bunch of things, so the question is how do you globally add a folder to the perl search path

View 1 Replies View Related

Programming :: Adding Directory To The Path?

Apr 2, 2009

I have made the installation of Qt4 in my Fedora/MacBookPro. It also got a first compiling and running a simple program. The point is that for the compiler to run I need to point out every time where the bin is located, as that:

$ /home/threader/kinetic/bin/qmake -project

I have tried the following, but it still doesn't work:

# script
#-----------------------------------------------------------#
# /etc/bashrc or /home/threader/.bash_profile
# config to Qt compiler

[code]....

View 5 Replies View Related

Programming :: Find With A Regex Path?

May 5, 2010

I'm using bash scripting to find any file that matches a path governed by the following regular expression:

"(monthly|nightly).[0-9]+/home/(user1|user2)/.mailbox/"
to match files like:
monthly.9/home/user1/.mailbox/l23131564
nightly.15/home/user2/.mailbox/cur/6546213

I've tried:

Code:
myRegex="(monthly|nightly).[0-9]+/home/(user1|user2)/.mailbox/"
find ./ -regextype posix-egrep -regex $myRegex

and it just spins and never gives me an answer, even though the file structure isn't that big.

View 8 Replies View Related

Programming :: Automate A Path Manipulation?

Jul 30, 2010

I want to share file locations with pc users (i'm a mac user). problem is: mac uses fslash, while pc files are indicated with baskslashes. I'm looking for a automation/plugin/shortcut/... to change them quick. I use paths a lot and share them with pc users, so manually it's to time consuming.

View 2 Replies View Related

Programming :: Get Full Path Of File In C?

Oct 28, 2010

Is there a way to get the full path of a file in C? I have a method that accepts a file name as an argument and is supposed to read the content of the file. The file name might include "../" so this might lead to accessing files outside of the current directory. I tried to use fstat but I could not figure out how to get the full path.

[code]...

View 3 Replies View Related

Programming :: Rails: No Path For Link_to

Jun 30, 2010

I'm still going through "Agile Web Development with Rails" (Beta version), and I'm confused as to why some code in the book is not working for me. Following their example code in the book, I created code like so:

Code:

$ rails demo
# ...
$ cd demo/
$ script/generate controller Say index hello goodbye
exists app/controllers/

[code]...

After starting the server, I can view the index view and the other views just fine. But then I have trouble if I add this code to any of the view html templates:

Code:

<p><%= link_to "Hello", say_hello_path %></p>

I'm told this is supposed to generate a link to the say/hello view. But instead I get an error message like so:

Code:

undefined local variable or method `say_hello_path' for #<ActionView::Base:0xb6ce3090>
If I edit it to

Code:

<p><%= link_to "Hello", Say_hello_path %></p>

then I get

Code:

uninitialized constant ActionView::Base::CompiledTemplates::Say_hello_path

But I haven't noticed anything in the book so far indicating that I am supposed to initialize these constants or how I am supposed to do it.

View 1 Replies View Related

Programming :: Set File Path For Different OS In Java

May 11, 2011

I'm fighting my way through JAVA. But have hit another wall. Basically I need to to set paths in java so it can set/read files/director for Linux,Mac and windows.

The tutorials I'm using says to do this through the FileSystems class eg

Code:

However this reports it is missing, so a look on line says I need the headers so I set them with

Code:

This gives the following error

This has me totally confused as the tutorial shows this and checking online shows this, do I need to link in libraries or something like that?

I'm using the latest Ubuntu 11.04 and netbeans.

View 4 Replies View Related

Programming :: Setting PATH Alias In Bash?

Jul 15, 2010

I am trying to execute executable files in bash without adding ./ I know there must be an alias to add in .bashrc, that must be something like alias PATH=$PATH:. But this seems not to be working.

View 1 Replies View Related

Programming :: [C#] Monodevelop Acces To The Path Is Denied?

May 29, 2011

i'm trying to run some code i had written a couple of weeks ago in windows :$, the program has to create and copy some files and when i try to run this code in monodevelop this error:Unhandled Exception: System.UnauthorizedAccessException:Access to the path '/tmp' is denied.i've tried to change the path where i know i have read/write permissions but it doesn't seem to work, the code was originally written to create a file in the Temp folder in windows.

View 1 Replies View Related

Programming :: API To Get Partition Name Based On File Path In C On OS?

Jul 19, 2011

Is there any API to get partition name based on file path in C on Linux OS?

View 1 Replies View Related

Programming :: Pass A Path As A String To A Variable?

Apr 17, 2009

I'm trying to pass a path as a string to an array, but its evaluating it as a command instead. I want to take the literal string "/mnt/accounts/user/temp/*.jpg" and assign it to an array{1}, but when i echo the array variable, it displays it as

pic1.jpg
pic2.jpg
pic3.jpg

[code]....

I just want it to be the actual text "/mnt/accounts/user/temp/*.jpg" which i will be combining with other text to create a longer path elsewhere in the code.

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved