Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Q: portable way copy files using C on Unix an Windows -- dirent or similar

Reply
Thread Tools

Q: portable way copy files using C on Unix an Windows -- dirent or similar

 
 
SM Ryan
Guest
Posts: n/a
 
      02-08-2006
"**--> That Guy Downstairs <--**" <(E-Mail Removed)> wrote:
# What files are needed to be #included to be able to copy files to a new
# directory and be portable?
# ie. use it in Unix (SGI and Linux) or Windows 2000.
# #ifdefs Ok.

You might consider something other than C, like Tcl or Perl.
In Tcl, you can do this portably in a few dozen lines. I expect
Perl to be as easy.

--
SM Ryan http://www.rawbw.com/~wyrmwif/
This is one wacky game show.
 
Reply With Quote
 
 
 
 
Old Wolf
Guest
Posts: n/a
 
      02-08-2006
**--> That Guy Downstairs <--** wrote:

> What files are needed to be #included to be able to copy files to a new
> directory and be portable?
> ie. use it in Unix (SGI and Linux) or Windows 2000.
> #ifdefs Ok.
>
> using dirent.h on SGI, but it's not working on Windows w/ VS6.0.


Upgrade your compiler? All the windows compilers I've ever used
provide the common unix functions (dirent.h etc).

 
Reply With Quote
 
 
 
 
Jack Klein
Guest
Posts: n/a
 
      02-08-2006
On 7 Feb 2006 18:18:06 -0800, "Old Wolf" <(E-Mail Removed)>
wrote in comp.lang.c:

> **--> That Guy Downstairs <--** wrote:
>
> > What files are needed to be #included to be able to copy files to a new
> > directory and be portable?
> > ie. use it in Unix (SGI and Linux) or Windows 2000.
> > #ifdefs Ok.
> >
> > using dirent.h on SGI, but it's not working on Windows w/ VS6.0.

>
> Upgrade your compiler? All the windows compilers I've ever used
> provide the common unix functions (dirent.h etc).


You haven't looked at quite enough Windows compilers. It's been
absent from Microsoft's Visual C++ since at least 6.0. The features
are quite easy to implement on top of the Win32 API, and every other
compiler that I know of for Win32 does so.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
 
Reply With Quote
 
Rod Pemberton
Guest
Posts: n/a
 
      02-08-2006

"**--> That Guy Downstairs <--**" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> What files are needed to be #included to be able to copy files to a new
> directory and be portable?
> ie. use it in Unix (SGI and Linux) or Windows 2000.
> #ifdefs Ok.
>
> using dirent.h on SGI, but it's not working on Windows w/ VS6.0.


I don't have a working solution for you. But, I have a place you can start.
Doug Gwyn's libndir. The file I have is called: libndir-posix.tar.Z. It
contains C code to add dirent and 'friends' to POSIX like OS's. You'll need
to do some porting.


Rod Pemberton


 
Reply With Quote
 
S7Solutions
Guest
Posts: n/a
 
      02-21-2006
Hi there

There is no one standard answer for this - it's a ocean of porting to
do but again depends on what and how much compatibility you are
expecting. If you want you can contact us for a free technical road map
for porting.

Manjunath M
S7 Software Solutions
Re-Defining Cross-Platform Porting & Migration
www.S7SOlutions.com

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
scandir file_select, text operations on const struct dirent *namelist) Sascha W├╝stemann C Programming 4 08-03-2011 07:27 AM
Need help with struct *** dirent ??? eddie C Programming 7 01-12-2009 01:48 PM
Getting MSVC to compile proper unix stuff, like hash_map, fts.h, dirent.h collection60@hotmail.com C++ 9 05-10-2006 06:59 PM
Dirent.h sargonisaac@gmail.com C++ 3 02-26-2006 05:24 PM
sizeof(struct dirent.d_ino) Martin Pohlack C Programming 19 09-09-2003 11:51 PM



Advertisments