| Author |
Deleteing a file inside a Cobol program
|
|
| jeff@sum-it.com 2006-10-12, 6:55 pm |
| Is there a system call or something I can use to delete a file from a
unix directory? I have a program that calls another program that
deletes a list of files, I need to be able to delete the from the
directory as well. They are in a subdir called reports. Any help would
be appreciated
| |
| Alain Reymond 2006-10-12, 6:55 pm |
| jeff@sum-it.com a écrit :
> Is there a system call or something I can use to delete a file from a
> unix directory? I have a program that calls another program that
> deletes a list of files, I need to be able to delete the from the
> directory as well. They are in a subdir called reports. Any help would
> be appreciated
>
You can use :
call "CBL_DELETE_FILE" using filename
returning status-code
And
call "CBL_DELETE_DIR" using path-name
returning status-code
for a directory.
Regards.
Alain
| |
| jeff@sum-it.com 2006-10-12, 6:55 pm |
| Thank you!!
Alain Reymond wrote:
> jeff@sum-it.com a =E9crit :
> You can use :
> call "CBL_DELETE_FILE" using filename
> returning status-code
>
> And
>
> call "CBL_DELETE_DIR" using path-name
> returning status-code
>=20
> for a directory.
>=20
> Regards.
>=20
> Alain
| |
| William M. Klein 2006-10-12, 6:55 pm |
| For this solution to work, you need to be using a compiler that supports "CBL_"
routines. Micro Focus originated these and Fujitsu has "emulation" routines. I
don't think any other COBOL Unix compiler would have them.
--
Bill Klein
wmklein <at> ix.netcom.com
"Alain Reymond" <arwebmail@skynet.be> wrote in message
news:452d2331$0$21498$ba620e4c@news.skynet.be...
> jeff@sum-it.com a écrit :
> You can use :
> call "CBL_DELETE_FILE" using filename
> returning status-code
>
> And
>
> call "CBL_DELETE_DIR" using path-name
> returning status-code
>
> for a directory.
>
> Regards.
>
> Alain
| |
| Richard 2006-10-12, 6:55 pm |
|
Alain Reymond wrote:
> You can use :
> call "CBL_DELETE_FILE" using filename
> returning status-code
>
> And
>
> call "CBL_DELETE_DIR" using path-name
> returning status-code
>
> for a directory.
Only if they have an appropriate version of MicroFocus COBOL or a
derivitive.
| |
| Frederico Fonseca 2006-10-12, 6:55 pm |
| On 11 Oct 2006 09:35:11 -0700, jeff@sum-it.com wrote:
>Is there a system call or something I can use to delete a file from a
>unix directory? I have a program that calls another program that
>deletes a list of files, I need to be able to delete the from the
>directory as well. They are in a subdir called reports. Any help would
>be appreciated
Which OS, COBOL Vendor and version?
Frederico Fonseca
ema il: frederico_fonseca at syssoft-int.com
| |
| jeff@sum-it.com 2006-10-12, 6:55 pm |
| Thank everybody for there help. Alain's solution worked fine. I am
running AcuCobol 7.2 on a Solaris box. Thanks again for everyone's
help!!!!
Frederico Fonseca wrote:
> On 11 Oct 2006 09:35:11 -0700, jeff@sum-it.com wrote:
>
> Which OS, COBOL Vendor and version?
>
>
> Frederico Fonseca
> ema il: frederico_fonseca at syssoft-int.com
| |
| Alistair 2006-10-12, 6:55 pm |
|
jeff@sum-it.com wrote:
> Is there a system call or something I can use to delete a file from a
> unix directory? I have a program that calls another program that
> deletes a list of files, I need to be able to delete the from the
> directory as well. They are in a subdir called reports. Any help would
> be appreciated
If you have a list of files then you should be able to feed the list
into a Unix script call which would delete each listed file.
| |
| HeyBub 2006-10-12, 6:55 pm |
| jeff@sum-it.com wrote:[color=darkred]
> Thank you!!
>
>
>
>
> Alain Reymond wrote:
Beware of filenames/paths containing imbedded spaces. Fujitsu has an
enhanced CBL routine for such:
CBL_DELETE_FILE2 USING...
|
|
|
|