C Programming question
Posted: 2006-10-24 11:36am
I am doing C course, and was wondering how to write a program that would print out all files in a given directory.
Get your fill of sci-fi, science, and mockery of stupid ideas
http://stardestroyer.dyndns-home.com/
http://stardestroyer.dyndns-home.com/viewtopic.php?f=24&t=99601
In unix / linux enviroments there are a whole heep of functions that deal with the operating system and manipulating the file system, I think they are in <unistd.h>, <stdio.h> and some others. Visual C++ has a crapload of stuff about manipulating windows ACL's and so on, but I can't remember exactly what.defanatic wrote:I am doing C course, and was wondering how to write a program that would print out all files in a given directory.
Code: Select all
directory='c:\' ; or some other directory
print, transpose(file_search(directory, '*'))
;or
files=directory+'*'
print, transpose(file_search(files))
Ah, but he has to do it in C, which means directly accessing the Win32 API. No MFC or .NET Framework for him!Chris OFarrell wrote:In unix / linux enviroments there are a whole heep of functions that deal with the operating system and manipulating the file system, I think they are in <unistd.h>, <stdio.h> and some others. Visual C++ has a crapload of stuff about manipulating windows ACL's and so on, but I can't remember exactly what.
Isn't the Win32 API quite good enough for this sort of work?phongn wrote:Ah, but he has to do it in C, which means directly accessing the Win32 API. No MFC or .NET Framework for him!Chris OFarrell wrote:In unix / linux enviroments there are a whole heep of functions that deal with the operating system and manipulating the file system, I think they are in <unistd.h>, <stdio.h> and some others. Visual C++ has a crapload of stuff about manipulating windows ACL's and so on, but I can't remember exactly what.