f



Determining file name with /proc/pid/fd/#?

Is there a way to determine the name of an open file?
I'm tired of not being able to determine if there is
a file open for writing that has been deleted.  If I
can get the  files each process has open I can check
if it exists and report back if it doesn't.

Just FYI, lsof does not show open files that are deleted.

TIA,

Roger Books

0
9/19/2005 8:42:54 PM
comp.unix.solaris 26022 articles. 2 followers. Post Follow

16 Replies
1815 Views

Similar Articles

[PageSpeed] 43

"roger.books@gmail.com" <roger.books@gmail.com> writes:

>Is there a way to determine the name of an open file?
>I'm tired of not being able to determine if there is
>a file open for writing that has been deleted.  If I
>can get the  files each process has open I can check
>if it exists and report back if it doesn't.

>Just FYI, lsof does not show open files that are deleted.

Yes, lsof DOES show open files that have been unlinked.
They can readily be identified by directing lsof to show
link count with the +L option.  Unlinked open files have
a link count of zero.

Because there is no DNLC information for unlinked files,
the identification lsof displays for them is basic --
device number, node number, and mounted-on directory and
mounted-on device paths.

Vic Abell, lsof author
0
abe
9/19/2005 6:35:31 PM
"roger.books@gmail.com" <roger.books@gmail.com> writes:

>Is there a way to determine the name of an open file?
>I'm tired of not being able to determine if there is
>a file open for writing that has been deleted.  If I
>can get the  files each process has open I can check
>if it exists and report back if it doesn't.

In S10 look at /proc/<pid>/path

If it's deleted, it has no name so none can be reported.

If you want to find open, yet deleted files and the processes
keeping them open:

	find /proc/*/fd -type f -links 0

Casper
-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
0
Casper
9/20/2005 8:56:28 AM
Casper H.S. Dik wrote:
> "roger.books@gmail.com" <roger.books@gmail.com> writes:
>
> >Is there a way to determine the name of an open file?
> >I'm tired of not being able to determine if there is
> >a file open for writing that has been deleted.  If I
> >can get the  files each process has open I can check
> >if it exists and report back if it doesn't.
>
> In S10 look at /proc/<pid>/path
>
> If it's deleted, it has no name so none can be reported.
>
> If you want to find open, yet deleted files and the processes
> keeping them open:
>
> 	find /proc/*/fd -type f -links 0
>
> Casper

Be wary of /proc/<pid>/path.  It depends on a path,
stored in the vnode, that is not carefully maintained.
Lsof uses it with great caution, checking it via stat(2)
before displaying it.

Vic Abell, lsof author

0
abe
9/20/2005 1:27:13 PM
abe@purdue.edu writes:

>Be wary of /proc/<pid>/path.  It depends on a path,
>stored in the vnode, that is not carefully maintained.
>Lsof uses it with great caution, checking it via stat(2)
>before displaying it.

Are you sure it returns an incorrect value rather than none?

Casper
0
Casper
9/20/2005 2:16:11 PM
Casper H.S. Dik <Casper.Dik@Sun.COM> writes:

>abe@purdue.edu writes:

>>Be wary of /proc/<pid>/path.  It depends on a path,
>>stored in the vnode, that is not carefully maintained.
>>Lsof uses it with great caution, checking it via stat(2)
>>before displaying it.

>Are you sure it returns an incorrect value rather than none?

>Casper

The vnode's v_path pointer is still set for unlinked open
files to te address of a kernel string that contains the
path under which the file was opened.  I just double-checked
that with dbx on a Solaris 10 Amd64 generic kernel.

The v_path pointer is also incorrect for files that have not
been unlinked when the paths under which they have been opened
have been changed -- i.e, with mv(1) or rename(2) has been
applied.  This is true for the three Solaris 10 architectures
-- Amd64, sun4u and i86pc -- where I have tested lsof.

Is there a patch that fixes either or both problems?

Vic Abell, lsof author
0
abe
9/20/2005 2:18:57 PM
Eric.Schrock@sun.no.spam.com (Eric Schrock) writes:

>In article <abe.1127243937@quest.cc.purdue.edu>, Victor A Abell wrote:
>>
>>The vnode's v_path pointer is still set for unlinked open
>>files to the address of a kernel string that contains the
>>path under which the file was opened.  I just double-checked
>>that with dbx on a Solaris 10 Amd64 generic kernel.
>>
>>The v_path pointer is also incorrect for files that have not
>>been unlinked when the paths under which they have been opened
>>have been changed -- i.e, with mv(1) or rename(2) has been
>>applied.  This is true for the three Solaris 10 architectures
>>-- Amd64, sun4u and i86pc -- where I have tested lsof.
>>
>>Is there a patch that fixes either or both problems?

>The above "problems" are both intrinsic to the design of v_path.  The
>path information was designed to aid in observability.  It never has had
>any guarantee associated with it that it is currently correct, only that
>it was correct at one point in time.  To do otherwise is to solve an
>essentially unsolvable problem (thanks to hard links) and require a huge
>amount of effort (requiring modifications to every filesystem) for
>little benefit - the current solution works in 99.9% of situations.

Yes, 99.9% accuracy is good and very useful, but a path that is
reported incorrectly is not good.  Fortunately validation (e.g., using
stat(2)) can help prevent the inaccuracy.  For 100% protection,
however, the stat(2) caller must have root permission to be able to
access any and all paths.

>Be sure to note that the information returned in /proc/<pid>/path
>_is_ guaranteed to be correct.  We perform the necessary validation on
>the stored path, and return no information (rather than incorrect
>information) if we cannot validate that it is correct.  It's also worth
>noting that the information has become quite a bit more reliable in
>Nevada build 21 and later, thanks to a slightly different
>interpositioning point.
>
>I would argue that having path information for unlinked vnodes is
>actually valuable, not a bug.  And as for renames, it too is an
>unsolvable problem, certainly at the VFS layer.  Imagine renaming a
>directory and having to update the path information for every child
>vnode on the system.  And storing a tree of pointers is not acceptable
>because the information must be calculable in arbitrary context in order
>to support the DTrace I/O provider, not to mention that there is no
>knowledge of vnode relationship at the VFS layer (and the DNLC is a
>partial solution used only by a few filesystems).

Because of the uncertainty that rename introduces, an unlinked file's
path is one that really can't be validated.  It probably should never
be reported.

>Suffice to say that the path information is behaving exactly as
>designed, and that there is no way to extend that design in an
>architecturally viable way (no changes outside the VFS layer) and
>maintining necessary constraints (DTrace observability, performance).

>Hope that helps.  Feel free to play around with the OpenSolaris source
>code if you think I'm wrong on either of these points.  You can find me
>(and more observability junkies) over at the observability community on
>opensolaris.org.
>--
>Eric Schrock, Solaris Kernel Development       http://blogs.sun.com/eschrock

Thank you for the information, Eric.

Vic Abell, lsof author
0
abe
9/20/2005 7:23:02 PM
In article <abe.1127243937@quest.cc.purdue.edu>, Victor A Abell wrote:
>
>The vnode's v_path pointer is still set for unlinked open
>files to te address of a kernel string that contains the
>path under which the file was opened.  I just double-checked
>that with dbx on a Solaris 10 Amd64 generic kernel.
>
>The v_path pointer is also incorrect for files that have not
>been unlinked when the paths under which they have been opened
>have been changed -- i.e, with mv(1) or rename(2) has been
>applied.  This is true for the three Solaris 10 architectures
>-- Amd64, sun4u and i86pc -- where I have tested lsof.
>
>Is there a patch that fixes either or both problems?

The above "problems" are both intrinsic to the design of v_path.  The
path information was designed to aid in observability.  It never has had
any guarantee associated with it that it is currently correct, only that
it was correct at one point in time.  To do otherwise is to solve an
essentially unsolvable problem (thanks to hard links) and require a huge
amount of effort (requiring modifications to every filesystem) for
little benefit - the current solution works in 99.9% of situations.

Be sure to note that the information returned in /proc/<pid>/path
_is_ guaranteed to be correct.  We perform the necessary validation on
the stored path, and return no information (rather than incorrect
information) if we cannot validate that it is correct.  It's also worth
noting that the information has become quite a bit more reliable in
Nevada build 21 and later, thanks to a slightly different
interpositioning point.

I would argue that having path information for unlinked vnodes is
actually valuable, not a bug.  And as for renames, it too is an
unsolvable problem, certainly at the VFS layer.  Imagine renaming a
directory and having to update the path information for every child
vnode on the system.  And storing a tree of pointers is not acceptable
because the information must be calculable in arbitrary context in order
to support the DTrace I/O provider, not to mention that there is no
knowledge of vnode relationship at the VFS layer (and the DNLC is a
partial solution used only by a few filesystems).

Suffice to say that the path information is behaving exactly as
designed, and that there is no way to extend that design in an
architecturally viable way (no changes outside the VFS layer) and
maintining necessary constraints (DTrace observability, performance).

Hope that helps.  Feel free to play around with the OpenSolaris source
code if you think I'm wrong on either of these points.  You can find me
(and more observability junkies) over at the observability community on
opensolaris.org.

- Eric

--
Eric Schrock, Solaris Kernel Development       http://blogs.sun.com/eschrock
0
Eric
9/20/2005 8:33:46 PM
In article <abe.1127262182@quest.cc.purdue.edu>, Victor A Abell wrote:
>
>Yes, 99.9% accuracy is good and very useful, but a path that is
>reported incorrectly is not good.  Fortunately validation (e.g., using
>stat(2)) can help prevent the inaccuracy.  For 100% protection,
>however, the stat(2) caller must have root permission to be able to
>access any and all paths.
>
>Because of the uncertainty that rename introduces, an unlinked file's
>path is one that really can't be validated.  It probably should never
>be reported.

I'd just like to emphasize for the readers out there that Victor's
qualms about the validity of path information only applies to the
correctness of the v_path as stored within the kernel.  It does not
apply to the paths as shown in /proc/<pid>/path/*.  These will always be
correct, and are validated within the kernel before being returned via
procfs.  You do _not_ need to worry about unlinked files or stat()ing
the results from reading these files.

For information on how this is done, see the implementation of
vnodetopath(), used by pr_readlink_lookup().

http://cvs.opensolaris.org/source/xref/usr/src/uts/common/fs/lookup.c#1347

- Eric

--
Eric Schrock, Solaris Kernel Development       http://blogs.sun.com/eschrock
0
Eric
9/21/2005 3:26:48 AM
Eric.Schrock@sun.no.spam.com (Eric Schrock) writes:

>In article <abe.1127262182@quest.cc.purdue.edu>, Victor A Abell wrote:
>>
>>Yes, 99.9% accuracy is good and very useful, but a path that is
>>reported incorrectly is not good.  Fortunately validation (e.g., using
>>stat(2)) can help prevent the inaccuracy.  For 100% protection,
>>however, the stat(2) caller must have root permission to be able to
>>access any and all paths.
>>
>>Because of the uncertainty that rename introduces, an unlinked file's
>>path is one that really can't be validated.  It probably should never
>>be reported.

>I'd just like to emphasize for the readers out there that Victor's
>qualms about the validity of path information only applies to the
>correctness of the v_path as stored within the kernel.  It does not
>apply to the paths as shown in /proc/<pid>/path/*.  These will always be
>correct, and are validated within the kernel before being returned via
>procfs.  You do _not_ need to worry about unlinked files or stat()ing
>the results from reading these files.

>For information on how this is done, see the implementation of
>vnodetopath(), used by pr_readlink_lookup().

>http://cvs.opensolaris.org/source/xref/usr/src/uts/common/fs/lookup.c#1347

Eric is right.  The vnodetopath() code is very careful to validate the
path.  It uses v_path as a starting point, but if it can't be
validated, then a reverse-lookup takes place.  That's probably the best
of all worlds for the VFS design, since the v_path "hint" will usually
be correct.

As for how this applies to the original question about unlinked paths,
it appears that /proc/<pid>/path/... will not be a symbolic link to
anything if the file has been unlinked.  The hint remains in the
vnode's v_path, but there's no way to validate it.  It might sometimes
be useful to report the hint, if it could be shown as only a hint and
not a certainty.

Vic Abell, lsof author
0
abe
9/21/2005 5:10:04 AM
Casper H.S. Dik <Casper.Dik@Sun.COM> writes:

>abe@quest.cc.purdue.edu (Victor A Abell) writes:

>>The vnode's v_path pointer is still set for unlinked open
>>files to te address of a kernel string that contains the
>>path under which the file was opened.  I just double-checked
>>that with dbx on a Solaris 10 Amd64 generic kernel.

>That's not the question I asked; the question I asked is:
>"is the /proc/<pid>/path incorrect in such cases"?

>If that's not the case then the value of v_path is
>irrelevant as the system treats it merely as a hint.

Sorry -- I didn't answer your question, did I?

/proc/<pid>/path/... will not be a symbolic link to anything if the
open file it represents has been unlinked.  The original path hint
remains in the vnode's v_path, however.  It might be useful to the OP
as a hint, could it be reported as just that.

Vic

0
abe
9/21/2005 5:19:03 AM
abe@quest.cc.purdue.edu (Victor A Abell) writes:

>The vnode's v_path pointer is still set for unlinked open
>files to te address of a kernel string that contains the
>path under which the file was opened.  I just double-checked
>that with dbx on a Solaris 10 Amd64 generic kernel.

That's not the question I asked; the question I asked is:
"is the /proc/<pid>/path incorrect in such cases"?

If that's not the case then the value of v_path is
irrelevant as the system treats it merely as a hint.

Casper
-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
0
Casper
9/21/2005 8:07:25 AM
Casper H.S. Dik <Casper.Dik@Sun.COM> writes:

>abe@quest.cc.purdue.edu (Victor A Abell) writes:

>>The vnode's v_path pointer is still set for unlinked open
>>files to te address of a kernel string that contains the
>>path under which the file was opened.  I just double-checked
>>that with dbx on a Solaris 10 Amd64 generic kernel.

>That's not the question I asked; the question I asked is:
>"is the /proc/<pid>/path incorrect in such cases"?

>If that's not the case then the value of v_path is
>irrelevant as the system treats it merely as a hint.

Eric already answered this and it seems that you can indeed
trust /proc/*/path information but not v_path which is what
Vic cares about for lsof.

Casper
-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
0
Casper
9/21/2005 8:41:35 AM
Casper H.S. Dik <Casper.Dik@Sun.COM> writes:

>abe@quest.cc.purdue.edu (Victor A Abell) writes:

>>As for how this applies to the original question about unlinked paths,
>>it appears that /proc/<pid>/path/... will not be a symbolic link to
>>anything if the file has been unlinked.  The hint remains in the
>>vnode's v_path, but there's no way to validate it.  It might sometimes
>>be useful to report the hint, if it could be shown as only a hint and
>>not a certainty.

>Yes, but an unlinked file has no name, really ...

However, I think that's what the OP wanted to know.  It seems a useful
item of information to me to know the path name under which a deleted
file was opened.

>(Last time I checked, Linux also gets a number of cases wrong in
>/proc)

I've not seen that, but I have seen many cases where the Linux /proc
file system does get the path name correct, even after components of
the path have been renamed.  Moreover, Linux /proc reports "(deleted)"
at the end of the open file's last known path when the file has been
unlinked.

Lsof 4.77 will have an option to make a similar "(deleted)" report.
Anyone who wants a look at that can try this 4.77 pre-release:

ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/NEW/lsof_4.77A.sun.tar.bz2

The -X option must be specified to lsof 4.77 to get the "(deleted)"
path name report.  There are some new FAQ entries discussing the cached
vnode path name lsof uses.

Vic
0
abe
9/21/2005 8:50:09 AM
abe@quest.cc.purdue.edu (Victor A Abell) writes:

>As for how this applies to the original question about unlinked paths,
>it appears that /proc/<pid>/path/... will not be a symbolic link to
>anything if the file has been unlinked.  The hint remains in the
>vnode's v_path, but there's no way to validate it.  It might sometimes
>be useful to report the hint, if it could be shown as only a hint and
>not a certainty.

Yes, but an unlinked file has no name, really ...

(Last time I checked, Linux also gets a number of cases wrong in
/proc)

Casper
-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
0
Casper
9/21/2005 12:35:32 PM
abe@quest.cc.purdue.edu (Victor A Abell) writes:

>I've not seen that, but I have seen many cases where the Linux /proc
>file system does get the path name correct, even after components of
>the path have been renamed.  Moreover, Linux /proc reports "(deleted)"
>at the end of the open file's last known path when the file has been
>unlinked.

There are a few cases with "ln/rm" which break.

A v_path implementation could be a linked list of vnodes all the
way up to the root so that it would construct the path on the fly
each time; that would fix a few of the corner cases.

The Solaris philosophy for "pseudo symlinks" is that they
return actual symlink content and not just hackish descriptive
text.

Casper
-- 
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
0
Casper
9/21/2005 3:01:27 PM
how can that removed link( viz /proc/pid/path/1) can be identified. and who would unlink it ?

-jagadeesh-
0
2/3/2014 6:04:42 AM
Reply:

Similar Artilces:

automatic naming of files based on the readed file name?
Using "write labview measurement file" and "read labview measurement file". For example: Readed_file.dat Readed_file_written.dat I recommended u to try "Long Path Tool" program .before I have problem like this. and after I found long path tool and now my problem solved markian -- ...

Unix help required: one line comand to date Column to a fixed length file parsing the file name
Hi , I have a fixed length file of records size 50 , file_nm.YYYYMMDD.dat . My requirement is that : To parse the file name for date and add the apped this date to the end of each record . After this the resultant record size becomes 58 . Is there one line command with AWK /SED i can make use for this purpose . Thanks in Advance , Ajay ajay.balki wrote: > Hi , > > I have a fixed length file of records size 50 , > file_nm.YYYYMMDD.dat . > My requirement is that : To parse the file name for date and add the > apped this date to the end of each record . > > Aft...

Re: couldn't open pid file '/var/run/named.pid': Permission denied
- /var/run/named.pid + /var/run/named/named.pid Looks like the path was wrong On 15/11/07 5:00 PM, "Pawe� Tobi�" <ptobis@interia.pl> wrote: > Wasn't it a selinux issue? > > Regards > Pawel Tobis > > > ---------------------------------------------------------------------- > Poznaj wschodzace gwiazdy polskiej muzyki! > Sluchaj i oceniaj >>> http://link.interia.pl/f1c66 > > -- Kal Feher Team Leader Network Services and Production Support Melbourne IT Ltd Level 2, 120 King Street Melbourne Victoria 3000 AUSTRALIA Ph: + 61 3 8624 2326 Mob: + 61 400 072 569 Website: www.MelbourneIT.com.au ...

file names Win to Unix
Hi, I have the following problem: my cgi script (on linux) accepts file uploads. I extract the file name with set clientfn [::ncgi::importFile -client if_soundfile] Someone managed to upload a file with a full windows path in the filename. No problem, you think? Just use [file tail]? It does not work. % set n c:\\Work\\testfiles\\sound.wav c:\Work\testfiles\sound.wav % file tail $n c:\Work\testfiles\sound.wav % Okay, I can use [string map] or do the whole thing with [regexp], but I expected [file tail] to be smarter. /Str. On Mar 8, 10:41=A0am, "M. Strobel" <sorry_no_mail_h...@nowhere.dee> wrote: > Hi, > > I have the following problem: > > my cgi script (on linux) accepts file uploads. I extract the file name wi= th > > set clientfn [::ncgi::importFile -client if_soundfile] > > Someone managed to upload a file with a full windows path in the filename= .. > > No problem, you think? Just use [file tail]? It does not work. > > % set n c:\\Work\\testfiles\\sound.wav > c:\Work\testfiles\sound.wav > % file tail $n > c:\Work\testfiles\sound.wav > % > > Okay, I can use [string map] or do the whole thing with [regexp], but I e= xpected [file tail] to be smarter. Wait... if someone "managed to upload" that file with that funny name, on a Linux system, you have final path: /some/upload/directory/c:\Work\testfiles\sound.wav So [file tail] is actually being smart about it, since it is really ...

Name of file that contains proc
Hello all, I'm wondering how to get the filename of the file that contains the procedure, when I run the procedure. For example, if I have file functions.tcl that contains this proc my_name, like so: ===functions.tcl=== proc my_name { } { puts ?????; } =============== Then if I go run tclsh, source functions.tcl, and run my_name, it should displays "functions.tcl". I tried global argv0, that gives me the name of the executable, [info script] gives me nothing (it works if I don't put it in the proc), and of course [info nameofexecutable] gives me /usr/bin/tclsh. Any help would be appreciated! Thanks. Andrew wrote: > Hello all, > > I'm wondering how to get the filename of the file that contains the > procedure, when I run the procedure. For example, if I have file > functions.tcl that contains this proc my_name, like so: > > ===functions.tcl=== > proc my_name { } { > puts ?????; > } > =============== > > > Then if I go run tclsh, source functions.tcl, and run my_name, it > should displays "functions.tcl". I tried global argv0, that gives me > the name of the executable, [info script] gives me nothing (it works > if I don't put it in the proc), and of course [info nameofexecutable] > gives me /usr/bin/tclsh. Any help would be appreciated! This same question was posted in the last two weeks. You may want to google for that thread and read it. -- +--------------------...

How to get the file name from a String containing the path plus the file name?
Hi, I have a String "dirA/dirB/dirC/file.txt". How to use String manipulation technique to get "file.txt"? String fullName = "dirA/dirB/dirC/file.txt"; int index = fullName.lastIndexOf("\\"); //here is a problem, if I try lastIndexOf("\"), there is a compile error String fileName = fullName.subString(index); //but does not work Thank you very much. ps: I am working on linux. www wrote: > Hi, > > I have a String "dirA/dirB/dirC/file.txt". How to use String > manipulation technique to get "...

change the name of log files in Unix
By default , unix generates a log file that has the same name as the sas file. I need to run the same sas file in parallel , so generating log files with the same name is giving me some trouble. Does anyone know to change the name of log files from command line ? Thanks a lot. ...

rename all the file names in a directory so that the first character of each file name is lower case
How to rename all the file names in a directory so that the first character of each file name is lower case in the bash shell? e.g. old file names are: Certificates General Util.dsp new file names become: certificates general util.dsp On 2008-09-07, TsanChung wrote: > How to rename all the file names in a directory so that the first > character of each file name is lower case in the bash shell? > e.g. > old file names are: > Certificates > General > Util.dsp > > new file names become: > certificates > general > util.dsp _lwr() { _LWR= case $1 in ...

Reading proc/pid/mem File
(Figured it deserves a different thread). I'm trying to read a different process's proc/pid/mem file given I know it's pid. here's my code: ===START string fn = "/proc/pid/mem"; //where pid is the right pid int fd = open(fn.c_str(), O_RDONLY); char* buff = new char[BUFF_SIZE]; int size = read(fd, buff, BUFF_SIZE); ===END No matter what BUFF_SIZE is, or whether I use lseek before (to change the cursur to a specific location), read always returns -1. I tried running the process with sudo but still no success. Any ideas? Thanks! --sternr sternr &...

logical puzzle: how to generate reasonable archive file names from file and directory names
I'm writing a module to convert between filesystem nodes (directory,file) and various archives (gz, zip, tgz). For this I want to automatically create reasonable file names for the archives where these file names depend from the type of the file system node to be archived and from the type of the archive to be created. I want the following transformations to take place: Dir abc =(gz)=> *not allowed* =(zip,tgz)=> abz.zip,abc.tgz abc.XY =(gz)=> *not allowed* =(zip,tgz)=> abc.XY.zip,abc.XY.tgz File abc =(gz)=> abc.gz...

Reading proc/pid/mem File
(Figured it deserves a different thread). I'm trying to read a different process's proc/pid/mem file given I know it's pid. here's my code: ===START string fn = "/proc/pid/mem"; //where pid is the right pid int fd = open(fn.c_str(), O_RDONLY); char* buff = new char[BUFF_SIZE]; int size = read(fd, buff, BUFF_SIZE); ===END No matter what BUFF_SIZE is, or whether I use lseek before (to change the cursur to a specific location), read always returns -1. I tried running the process with sudo but still no success. Any ideas? Thanks! --sternr sternr &...

Determine Computer Name That is Accessing File
I have been trying to find some API routines that will allow me to determine the name of the computer that is accessing a file on a server. I have found the NetFileEnum call (returns the names of the files in use and the names of the users accessing them). I have also found the NetConnectionEnum call (returns the name of the computer that is accessing a share). I do not see any way of correlating the data that these two api calls return. Can anyone point me in the right direction? Thanks. -Vincent Hi Vincent, This function (see below) will return the name of the local computer, if you...

Function to validate a Unix file name?
Hi, Can anyone provide a function that can validate if a string would pass as a valid Unix (specifically Fedora Core 8 Linux) file name? For example, I'm fairly certain one of the rules is that the file name cannot contain a "&" character. There are probably a lot of other rules I don't know about. Thanks, - Dave laredotornado <laredotornado@zipmail.com> writes: > Hi, > > Can anyone provide a function that can validate if a string would pass > as a valid Unix (specifically Fedora Core 8 Linux) file name? For > example, I'm fairly certain on...

Downloading blob will save the file by the procedure name and not the actual file name
Hi, I am using PL/SQL web toolkit to open documents in a browser. The documents are stored as BLOB data types. I am using the below procedure "viewer.sql" to open the documents based on the mime types. My question: When I try to save the opened document, I see that the file name is that of the procedure name in the URL and not the actual filename. I have the filename stored in the database. Is there a way to change the filename? Actual code.... CREATE OR REPLACE PROCEDURE VIEWER (DOC_LOC IN NUMBER,D_ID IN NUMBER) AS V_file_ext VARCHAR2(5) V_blob BLOB; buffer raw(32767); buffer_size integer := 32767; offset integer := 1; length number; BEGIN THEN BEGIN SELECT FILE_EXT,ATTACHMENT INTO V_file_ext,V_blob FROM RBCMS_INBOX WHERE MAIL_ID= D_ID; EXCEPTION WHEN NO_DATA_FOUND THEN htp.p('Documents not found'); END; ELSIF doc_loc = 2 THEN BEGIN SELECT DOC_EXT,DOCUMENT INTO V_file_ext,V_blob FROM RBCMS_DOCUMENTS WHERE DOC_ID = D_ID; EXCEPTION WHEN NO_DATA_FOUND THEN htp.p('Documents not found'); END; ELSE NULL; END IF; /*********** Determines the mime type for the document to be displayed***********/ IF UPPER(V_FILE_EXT)='PDF' THEN owa_util.mime_header('application/pdf'); ELSIF UPPER(V_FILE_EXT)='DOC&#...

Extracting variables from multiple *.txt files and having the variable name dependent on the name of the *.txt file
I have about 30 *.txt files that have contain data in the same format. I'd like to extract a certain set of data from each of these files, and store them as their own variables, not in a matrix. Each file name is structured in the following way: name_20xx_yy.txt where xx reflects the 2-digit year and yy reflects the 2-digit month of each data set. I'd like to be able to create column vectors from the data set that reflect the different data sets that they come from, i.e. var_20xx_yy= name_20xx_yy(:,3) This way I will have 30 different var_xx_yy variables each reflect...

File name from file description
Hi, I am new to this group. I had just one small question Is it possible to get the file name back from file descriptor. i.e. I have written a function to overload the libc write using LD_PRELOAD my_write(int fd, void *buf, size_t nbytes) In this function is it possible to find the filename from "fd". thanks amit On 28 Mar 2006 11:45:02 -0800, in comp.lang.c , "poddar" <poddar007@gmail.com> wrote: >Hi, > >I am new to this group. I had just one small question > >Is it possible to get the file name back from file descriptor. C doesn't have ...

UNDEFINED DATA BLOCK MAP BY NAME FOR FILE:<file name> in Tandem server
Hi, I have compiled a C program in Tandem server. (This program was successfully compiled and tested in windows environment.) However while trying to run the object file generated in Tandem (ofcourse in a Tandem server), I get the below error UNDEFINED DATA BLOCK MAP BY NAME FOR FILE: <object file name> NAME $_ctype _ctype_local Can some one let me know the remedy for this please? JK On 12/17/2012 12:53 PM, jk__c wrote: > Hi, > > I have compiled a C program in Tandem server. (This program was successfully compiled and tested in windows environment.) However while trying to run the object file generated in Tandem (ofcourse in a Tandem server), I get the below error > UNDEFINED DATA BLOCK MAP BY NAME FOR FILE: <object file name> > > NAME > > $_ctype > _ctype_local > > Can some one let me know the remedy for this please? > JK Possibly - but if so, they may need more information. Is that the full exact text of the error message? Even the "object file name" part? If not, please provide the full error message. The options you passed to the compiler would also be helpful. The single most helpful thing you could provide, however, would be a version of the code that fails to compile, which has been trimmed to be as small as possible while still demonstrating that failure. Make sure, before posting, that the simplified version you're posting does indeed still fail to...

File name from file description
Hi, I am new to this group. I had just one small question Is it possible to get the file name back from file descriptor. i.e. I have written a function to overload the libc write using LD_PRELOAD my_write(int fd, void *buf, size_t nbytes) In this function is it possible to find the filename from "fd". thanks amit poddar007@gmail.com writes: > Hi, > > I am new to this group. I had just one small question > > Is it possible to get the file name back from file descriptor. No. There is no such thing as "the filename". On some Unixes you can get a fil...

how build package dll for freewrap with virtual lib file names instead of real lib file names
Hello, I have been using Freewrap for a program that runs on Windows systems. I have a number of utility vc++ programs that I call but I would like them integrated into freewrap as a tcl package. Tcl_CreateCommand is used in this code. Used vc++ 6 and Visual Studio and created the dll package file that works when running the code as a wish script with a load command giving the location of the dll and the name of the package. This does not work with the code in a freewrap exe. I understand that this is because of the problem of the required files for tcl/tk being in a virtual stor...

Bash: strip file path and file extension from a file name in a $string?
It appears that Bash supports stripping a match of $substring from $string from the front and from the back of $string through the following commands: ${string#substring} ${string%substring} Yet, it doesn't appear that it is possible to simultaneously strip a couple of substrings from the front and from the back of a string, which is a bit of a problem if a user intends to strip the path and file extension from a file listing. Nonetheless, this is certainly possible. So, is it possible to strip both the path and the file extension from a file? If so, can anyone prov...

File, Find References, Copy Files: Truncating Long File Names
Hello All- I just experienced this behavior this morning. It was repeatable. Has anyone else seen this? The file Name was cut off after 57 characters. XP Pro SP2 2006 SP0 Office XP 2003 Pro Best Regards, Devon T. Sowell www.3-ddesignsolutions.com How long was the path name in total? Total including the file extension (.SLDASM) = 174. The file Extension was retained, just the Name was chopped off. These are my customer's files. Best Regards, Devon T. Sowell www.3-ddesignsolutions.com "TOP" <kellnerp@cbd.net> wrote in message news:1128364278.638472.150320@f14g2000...

Determining name/paths of source-d files at runtime
Hi Is there a way in TCL to know (at runtime): 1. Name/Path of all files sourced using source command 2. Name/Path of the file containing a a proc, for e.g., foo, assuming that the file is sourced in the interpreter and the function definition is availble. 3. Name/Path of the file containing a a proc, for e.g., foo, assuming that the file is sourced in the interpreter and the function definition is availble and the function is invoked. In other words, if I want to display the path/name of the file and function name upon invocation. Any info. will be of great help. Regard Sharad Sharad schrieb: > Hi > > Is there a way in TCL to know (at runtime): > 1. Name/Path of all files sourced using source command > 2. Name/Path of the file containing a a proc, for e.g., foo, assuming > that the file is sourced in the interpreter and the function > definition is availble. > 3. Name/Path of the file containing a a proc, for e.g., foo, assuming > that the file is sourced in the interpreter and the function > definition is availble and the function is invoked. In other words, if > I want to display the path/name of the file and function name upon > invocation. > Only if you overload the source command with your own version. info script tells you the info for the running script, and info commands and friends lets you see what is there so you can note stuff before and after load. Michael Thanks Michael. I thought of this earlier and just tried ...

HD file system corrupted after delete file on a share file on Solaris 8
Hi , I installed Samba 2.2.8a on a sparc system Solaris 8 and all works except when I delete a file or a folder into the share file with a windows 2000 pro, the HD ufs file system fall into a corrupt state and if I pass fsck on the disk it report some UNREF DIR on pass 3 and LINK COUNT problem on pass 4. What could be the problem ? I changed the HD and I have the same problem. Please help and thanks for your help Dano ...

Possible to convert the character set of file names in linux/unix?
Hello, I encountered a problem of file names with different character sets. For example, the linux system is using UTF-8, however, some programs write files using different character sets, say Samba configured with writing/reading file name using GB18030. My question is: Is there a program or a simple shell script to convert the file name from one character set to another. I know the command "iconv" can do the conversion but it only works on file contents. Thanks a lot! Regards, Robin On 3 Jul 2006 21:52:17 -0700, Robin wrote: > Hello, > > I encountered a problem of fi...

Web resources about - Determining file name with /proc/pid/fd/#? - comp.unix.solaris

Complementarity determining region - Wikipedia, the free encyclopedia
Complementarity determining regions ( CDRs ) are part of the variable chains in immunoglobulins (antibodies) and T cell receptors , generated ...

Determining Business Value
... What I will attempt to do in this blog is provide a model for looking at business value focusing on the portfolio [...] The post Determining ...

Determining Sea Level
It’s much more complicated than you think:


Mac notebooks: Determining battery cycle count
For computers with Mac OS X v10.4.x or later, use the steps in this article to determine the cycles on your Mac notebook's battery.

Determining Valuation Multiples
Last week on MBA Mondays, I talked about valuing an internet marketplace business. In that post, I talked about using 1x gross marketplace transactions ...

An alternative method for determining defensive WAR
... that David Wright is a scratch defender at third, but the data produces blips from year to year, maybe the data isn't right. Maybe when determining ...

NBA Preseason Determining Destinies for Houston Rockets Bench
HOUSTON—It’s the night of Oct. 13, 2014, and the Houston Rockets are hosting the Phoenix Suns . Dwight Howard and James Harden are sitting this ...

"The federal health care exchange is incorrectly determining that some people are eligible for Medicaid ...
"... leaving them with little chance to get the subsidized insurance they are entitled to as the Dec. 23 deadline for enrollment approaches." ...

DETERMINING IF WE NEED ANOTHER BUSH AS PRESIDENT: Using the Common Core Method
... invested by dousing it in gasoline and then applying a lit sparkler. Best, Doug For the rest of America, there's this: MT @darmercurio: Determining ...

Resources last updated: 3/17/2016 7:50:15 AM