Sponsored Content
Top Forums UNIX for Dummies Questions & Answers tag/mark a file with current absolute path Post 302379426 by jim mcnamara on Thursday 10th of December 2009 04:13:41 PM
Old 12-10-2009
Maintain a repository that 'remembers' the old absolute path for all your files. It can be db tables or a physical file.

I saw a cvs hack that kept track of files and directories by moving the real file somewhere, then creating a small 6-8 byte file of the same name and checking it into cvs. The downside was setting up dozens of fake source directories. I have never tried this so I cannot vouch for it's robustness.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

want the current directory without the absolute path

Hi guys I'm trying to move an empty directory to the $TRASH directory. Say the directory i have is ./hello/hello1/hello2 and i'm in hello2, and i want hello2 moved. this code: TRASH=$home/deleted find "$TRASH/$1" -type d -exec rmdir { } \; 2>/dev/null mv -f $1 $TRASH 2>/dev/null works... (2 Replies)
Discussion started by: olimiles
2 Replies

2. UNIX for Dummies Questions & Answers

vi - replacing a relative path with absolute path in a file

Hi, I have a file with about 60 lines of path: app-defaults/boxXYZ....... I want to change this to /my/path/goes/here/app-defaults/boxXYZ, but of course vi doesn't like the regualr :s/old/new/ command. Is there any other quick way to do this? Thanks ;) (2 Replies)
Discussion started by: Yinzer955i
2 Replies

3. UNIX for Dummies Questions & Answers

absolute path

is cd ~ considered an absolute path? (2 Replies)
Discussion started by: Kirichiko
2 Replies

4. UNIX for Advanced & Expert Users

How to get Absolute path from file descriptors

Hello all, my question is whether it possible to get the complete path of a file from the file descriptor iam going through some code for which i dont understood this statement ifstream s((const byte*)fd); what exactly this represents any idea. which is not properly working is there any way... (2 Replies)
Discussion started by: vinp
2 Replies

5. UNIX for Dummies Questions & Answers

Help with absolute path and relative path

I'm having problems accessing the Knoppix software on my current computer and the replacement CD I ordered hasn't arrived yet. I have a guess at what the answer would be for this question but I am not sure as I cannot test it with the software. I have to create a directory called class, and... (1 Reply)
Discussion started by: mzero
1 Replies

6. Shell Programming and Scripting

absolute path for a script ran with relative path

I have a script in which i want to print absolute path of the same script irrespective of path from where i run script. I am using test.sh: echo "pwd : `pwd`" echo "script name: $0" echo "dirname: `dirname $0`" when i run script from /my/test/dir/struct as ../test.sh the output i... (10 Replies)
Discussion started by: rss67
10 Replies

7. Shell Programming and Scripting

search pattern and mark/tag

Hi All, I have to search for patterns from a pattern file in a file and mark the matching lines. Input File: Student1 60 30 Student2 71 91 Student3 88 98 Pattern file: Student1 Fail Student2 Pass Student2 Pass Desired output: Student1 60 30 Fail Student2 71 91 Pass (5 Replies)
Discussion started by: saint2006
5 Replies

8. Shell Programming and Scripting

How to change Absolute path to Relative path

Hello, I have a doubt:- --------------------- Current script:- ################################################################################################ prefix=user@my-server: find . -depth -type d -name .git -printf '%h\0' | while read -d "" path ; do ( cd "$path" || exit $?... (4 Replies)
Discussion started by: sahil_jammu
4 Replies

9. UNIX for Dummies Questions & Answers

How to convert relative path to absolute path?

Hello Everyone, I want to convert Relative Path - /home/stevin/data/APP_SERVICE/../datafile.txt to Absolute Path - /home/stevin/data/datafile.txt Is there a built-in tool in Unix to do this or any good ideas as to how can I implement this. -Steve (5 Replies)
Discussion started by: qwarentine
5 Replies

10. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies
SOCKATMARK(3P)						     POSIX Programmer's Manual						    SOCKATMARK(3P)

PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond- ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux. NAME
sockatmark - determine whether a socket is at the out-of-band mark SYNOPSIS
#include <sys/socket.h> int sockatmark(int s); DESCRIPTION
The sockatmark() function shall determine whether the socket specified by the descriptor s is at the out-of-band data mark (see the System Interfaces volume of IEEE Std 1003.1-2001, Section 2.10.12, Socket Out-of-Band State). If the protocol for the socket supports out-of-band data by marking the stream with an out-of-band data mark, the sockatmark() function shall return 1 when all data preceding the mark has been read and the out-of-band data mark is the first element in the receive queue. The sockatmark() function shall not remove the mark from the stream. RETURN VALUE
Upon successful completion, the sockatmark() function shall return a value indicating whether the socket is at an out-of-band data mark. If the protocol has marked the data stream and all data preceding the mark has been read, the return value shall be 1; if there is no mark, or if data precedes the mark in the receive queue, the sockatmark() function shall return 0. Otherwise, it shall return a value of -1 and set errno to indicate the error. ERRORS
The sockatmark() function shall fail if: EBADF The s argument is not a valid file descriptor. ENOTTY The s argument does not specify a descriptor for a socket. The following sections are informative. EXAMPLES
None. APPLICATION USAGE
The use of this function between receive operations allows an application to determine which received data precedes the out-of-band data and which follows the out-of-band data. There is an inherent race condition in the use of this function. On an empty receive queue, the current read of the location might well be at the "mark", but the system has no way of knowing that the next data segment that will arrive from the network will carry the mark, and sockatmark() will return false, and the next read operation will silently consume the mark. Hence, this function can only be used reliably when the application already knows that the out-of-band data has been seen by the system or that it is known that there is data waiting to be read at the socket (via SIGURG or select()). See Socket Receive Queue, Socket Out-of-Band Data State, Signals, and pselect() for details. RATIONALE
The sockatmark() function replaces the historical SIOCATMARK command to ioctl() which implemented the same functionality on many implemen- tations. Using a wrapper function follows the adopted conventions to avoid specifying commands to the ioctl() function, other than those now included to support XSI STREAMS. The sockatmark() function could be implemented as follows: #include <sys/ioctl.h> int sockatmark(int s) { int val; if (ioctl(s,SIOCATMARK,&val)==-1) return(-1); return(val); } The use of [ENOTTY] to indicate an incorrect descriptor type matches the historical behavior of SIOCATMARK. FUTURE DIRECTIONS
None. SEE ALSO
pselect(), recv(), recvmsg(), the Base Definitions volume of IEEE Std 1003.1-2001, <sys/socket.h> COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2003 Edition, Standard for Information Technol- ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html . IEEE
/The Open Group 2003 SOCKATMARK(3P)
All times are GMT -4. The time now is 02:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy