a function to get the full path names of a list of files

R

redstone-cold

First ,I am not a C++ programmer but a python programmer .I am only a little familiar with C++ ,so I cannot implement this function myself ,my use of this function is to wrap it into Python to improve my program’s working efficiency .

I have already know a list of files in a specified directory or its subdirectories , I need a function to get the full path names of this list of files ,now I am going to give out the prototype of this function , I wonder if you can help me to implement this function .

function name : get FullPathNames
parameter : the path to the parent directory that all of that list of filesare contained in, a list of file names the I need to get their full path names back

return value : a list of full path names

thanks in advance !
 
R

redstone-cold

在 2013å¹´1月31日星期四UTC+8上åˆ10æ—¶07分36秒,[email protected]写é“:
First ,I am not a C++ programmer but a python programmer .I am only a little familiar with C++ ,so I cannot implement this function myself ,my use of this function is to wrap it into Python to improve my program’s working efficiency . I have already know a list of files in a specified directory or its subdirectories , I need a function to get the full path names of this list of files ,now I am going to give out the prototype of this function , I wonder if you can help me to implement this function . function name : get FullPathNames parameter : the path to the parent directory that all of that list of files are contained in, a list of file names the I need to get their full path names back return value : a list of full path names thanks in advance !

I use it on WinXP
 
A

Alain Ketterlin

First ,I am not a C++ programmer but a python programmer .I am only a
little familiar with C++ ,so I cannot implement this function myself
,my use of this function is to wrap it into Python to improve my
program’s working efficiency .

Luca gave you an answer, but I really doubt you'll gain anything by
rewriting your python code (presumably something like
"[os.path.join(parent,path) for path in paths]") in C++. Except of
course if your only goal is to learn something new.

-- Alain.
 
Ö

Öö Tiib

I have already know a list of files in a specified directory or
its subdirectories , I need a function to get the full path names
of this list of files ,now I am going to give out the prototype of
this function , I wonder if you can help me to implement this function.

If it is some homework then ... that was meant for you to learn
something, why you ask us to spoil the purpose for you?

If you need it as Python programmer then you should not implement it
in C++ to use it in Python. Additional layer of C++ between your
Python code and operating system wins you nothing. Same written in
Python works as quickly.

All the functionality you asked is already present in file system
kernel of operating system. I am not sure if it is implemented in C,
C++, assembler or in mix of those but majority of running time of it
will go to I/O operations of hard drive driver.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top