C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 10th, 2007, 02:30 PM
dellthinker's Avatar
dellthinker dellthinker is offline
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2006
Location: /etc/hosts.allow
Posts: 245 dellthinker Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 2 Days 20 h 35 m 40 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Delete file

Hi all, would anyone know what WinAPI you call to delete a file? Or is it standard C++ ? Just curious, thanx in advance!

Reply With Quote
  #2  
Old July 10th, 2007, 02:44 PM
dwise1_aol's Avatar
dwise1_aol dwise1_aol is offline
Contributing User
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Jan 2003
Location: USA
Posts: 6,142 dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level)dwise1_aol User rank is General 15th Grade (Above 100000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 4 Days 33 m 48 sec
Reputation Power: 1974
The Win32 API does have a DeleteFile() as well as a CopyFile, a MoveFile, a CreateDirectory, and a RemoveDirectory.

The more traditional functions are more OS-dependent. Traditionally, the command to delete a file was unlink(). The reason for the name is because it comes from UNIX where you can create any number of symbolic links to the same file or directory, so most of the time that you would "delete a file" you'd actually be removing a link to a file, leaving the file itself alone, hence you'd actually be removing a link or "unlink"'ing.

MS Visual C++ still supports unlink() in all versions of its C runtime library, though it prefaces it with an underscore: _unlink.

Reply With Quote
  #3  
Old July 10th, 2007, 02:57 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,345 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 38 m 38 sec
Reputation Power: 54
The C standard (ISO C) supports
Code:
int remove(const char *path);

<stdio.h> and <cstdio>

Reply With Quote
  #4  
Old July 10th, 2007, 02:57 PM
ZuK ZuK is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2005
Posts: 580 ZuK User rank is Second Lieutenant (5000 - 10000 Reputation Level)ZuK User rank is Second Lieutenant (5000 - 10000 Reputation Level)ZuK User rank is Second Lieutenant (5000 - 10000 Reputation Level)ZuK User rank is Second Lieutenant (5000 - 10000 Reputation Level)ZuK User rank is Second Lieutenant (5000 - 10000 Reputation Level)ZuK User rank is Second Lieutenant (5000 - 10000 Reputation Level)ZuK User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Month 2 Days 13 h 12 m 36 sec
Reputation Power: 96
and there is
Code:
int remove( const char *fname );

in stdio.h
Kurt

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > Delete file

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap