Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   a function to get the full path names of a list of files (http://www.velocityreviews.com/forums/t957137-a-function-to-get-the-full-path-names-of-a-list-of-files.html)

redstone-cold@163.com 01-31-2013 02:07 AM

a function to get the full path names of a list of files
 
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 programs 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 !

redstone-cold@163.com 01-31-2013 02:14 AM

Re: a function to get the full path names of a list of files
 
在 2013年1月31日星期四UTC+8上午10时07分36 ,redsto...@163.com写道:
> 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

Alain Ketterlin 01-31-2013 02:15 PM

Re: a function to get the full path names of a list of files
 
redstone-cold@163.com writes:

> 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 02-01-2013 12:38 PM

Re: a function to get the full path names of a list of files
 
On Thursday, 31 January 2013 04:07:36 UTC+2, redsto...@163.com wrote:
> 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.




All times are GMT. The time now is 12:43 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.