\doc\web\99\05\doswin32.txt @How do I replace _dos_getdiskfree and Get/SetCurrentDirectory ==> 在 chy.bbs@bbs.cs.nthu.edu.tw (悲歡離合總是緣... 的文章中提到: > In win 3.1, I use _dos_getdiskfree() to retrieve the info about > the disk free space and it works well. > But in Win32, I can not find the counterpart function? > Does anyone have any suggestion? > Thank for your kindly help. > DESPERED ^-^... Try GetDiskFreeSpace(). #include , Syntax unsigned _dos_getdiskfree( unsigned drive, struct _diskfree_t * diskspace ); Chris Marriott wrote in message ... >In article <667u5p$hhu25@nrn2.NRCan.gc.ca>, "John A. Grant" > writes >>So here are my questions: [...chdir wraps SetCurrentDirectory as I suspected...] >With Microsoft compilers, both "SetCurrentDirectory" and "_chdir" can be >used to change both the directory *and* the drive. Ok, that's what I wanted to hear. I'll #ifdef _dos_getdrive() for Win16 only & rely on chdir() to do the Right Thing for Win32. [...] >> but I can only find @Get/SetCurrentDirectory. So where are >> the Get/SetCurrentDrive functions? Assuming chdir() >> & SetCurrentDirectory() won't change drive for me, where >> is the replacement for _dos_setdrive()? > >There is no "SetCurrentDrive" API. "SetCurrentDirectory" changes both >drive *and* directory. Yeah, I could see there was no SetCurrentDrive(), but there's a reference to it in a comment in my BC++ 5.02 shellapi.h. I found it when I grepped for 'drive'. The comment is just above the SHFILEOPSTRUCTA typedef: " ... // implicit parameters are: // if pFrom or pTo are unqualified names the current directories are // taken from the global current drive/directory settings managed // by Get/SetCurrentDrive/Directory ..." ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ It's either: (a) a typo (b) a function that was never implemented (b) a function that was subsequently removed (c) a function that was eventually rolled into the ...Directory() function [...UNC...] Thanks for the clarifications (Chris & Bunny). -- John A. Grant * I speak only for myself * jagrant@znrcan.gc.ca (remove 'z') Airborne Geophysics, Geological Survey of Canada, Ottawa If you followup, please do NOT e-mail me a copy: I will read it here.