Hi
Env GnuCobol 3.2 on Lubuntu 24.04
Managing a big program i commit a keyboard error writing an unwanted blank
but this shows me what can be an bug in gnucobol (IMHO)
But file is not deleted because the leading blank
the same if i code
CALL 'CBL_DELETE_FILE' USING ' MAG0050'
in this second case compiler should check for leading blanks and warn
in the first case runtime code should trim string to the left ...
Thanks in advance for the support
Maurizio
Last edit: Maurizio Bongini 2025-05-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To ask COBOL to "guess" your intent seems like a good application for an AI enabled COBOL.
Adding a test of return-code after the call would indicate the success of the call.
Your example is not a GnuCOBOL bug.
It was a defect in your program.
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
I do not agree ...
i did not code an invalid file name
MAG0050 exists
I read documentation before posting and it is written it behaves like rm commnad
if i write
rm MAG0050
wiht two spaces between rm and MAG0050 it works
it ithe Gnucobol manual is s not written leading blanks cause this function to fail
please do not tell me about AI or other things out of dicusssion , in the previous post i opened i had reason it was a bug... please read all ... i do not open threads because i'm stupid
i corrected immediately the code before opening the thread it takes 30 seconds to find the problem ... do not teach me to check return code, i passed all my working life in IBM to check return codes to debug
my keystroke error cusally shows a lack in the code... in my humble opinion
i thinki have the duty to signal problems when they happens
regards
Last edit: Maurizio Bongini 2025-05-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It does behave identical, as you effectively wrote rm " MAG0050" - which is a totally valid command, deleting a file with a very uncommon name (leading space).
But feel free to make a suggestion where exactly we should add the quotes in the documentation to make the point clearer.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I disagree with your disagreement
If there was not a defect in your program - it would work as you expected.
"I passed all my working life in IBM"
So did I - IBM will not process a DSN with a leading space, an embedded space.
Expecting COBOL, irrespective of vendor, to discern your defect of a leading space ain't gonna happen
Last edit: Ralph Linkletter 2025-05-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
i', mot interest in polemics... you started a polemic with me i do not know why ...
please read carefully before accusing people ... read again what i wrote and what Simon answered.. the book does not reports that rm command will enclosse filename into
rm " xxxx ". this change the behaviour of command if instead using rm xxxx...
Last edit: Maurizio Bongini 2025-05-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
i', mot interest in polemics... you started a polemic with me i do not
know why ...
please read carefully before accusing people ... read again what i
wrote and what Simon answered.. the book does not reports that rm
command will be enclosed filename into rm " xxxx ".
this change the behaviour of command if instead using rm xxxx...
I was not involved with this BUT the bug is with your program, not the
compiler and generated code.
Computers are not mind readers and can only work based on your programming.
As pointed out to you by another, you did not specify exactly the file
name in your ASSIGN.
So fix the coed error and rerun - joining the rest of us finding bugs in
our code :)
You indicated in your original email that this statement was a COBOL bug
"CALL 'CBL_DELETE_FILE' USING 'bMAG0050' where b is a space.
That program is defective. Period !
To change the discussion to a Linux operating CLI is your own windmill to tilt at.
I am done with this thread :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are yo uaware that ..
In your first answer you offended me treating me like an idiot ?
So Keep your offenses for yourself !
STOP !
Next if you want change this on the book
... done using rm
to
....done using rm (with filename enclosed into double quotes)
Last edit: Maurizio Bongini 2025-05-18
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
Env GnuCobol 3.2 on Lubuntu 24.04
Managing a big program i commit a keyboard error writing an unwanted blank
but this shows me what can be an bug in gnucobol (IMHO)
But file is not deleted because the leading blank
the same if i code
CALL 'CBL_DELETE_FILE' USING ' MAG0050'
in this second case compiler should check for leading blanks and warn
in the first case runtime code should trim string to the left ...
Thanks in advance for the support
Maurizio
Last edit: Maurizio Bongini 2025-05-17
Hi, I suggest you to also check the GnuCOBOL statement
DELETE FILE
described in the chapter 7.8.11 DELETE of programmer's Guide.To ask COBOL to "guess" your intent seems like a good application for an AI enabled COBOL.
Adding a test of return-code after the call would indicate the success of the call.
Your example is not a GnuCOBOL bug.
It was a defect in your program.
Hi
I do not agree ...
i did not code an invalid file name
MAG0050 exists
I read documentation before posting and it is written it behaves like rm commnad
if i write
rm MAG0050
wiht two spaces between rm and MAG0050 it works
it ithe Gnucobol manual is s not written leading blanks cause this function to fail
please do not tell me about AI or other things out of dicusssion , in the previous post i opened i had reason it was a bug... please read all ... i do not open threads because i'm stupid
i corrected immediately the code before opening the thread it takes 30 seconds to find the problem ... do not teach me to check return code, i passed all my working life in IBM to check return codes to debug
my keystroke error cusally shows a lack in the code... in my humble opinion
i thinki have the duty to signal problems when they happens
regards
Last edit: Maurizio Bongini 2025-05-17
It does behave identical, as you effectively wrote
rm " MAG0050"
- which is a totally valid command, deleting a file with a very uncommon name (leading space).But feel free to make a suggestion where exactly we should add the quotes in the documentation to make the point clearer.
And for your edit: thank you for taking the time to check with any potential problems (here possibly the documentation). It is appreciated.
I disagree with your disagreement
If there was not a defect in your program - it would work as you expected.
"I passed all my working life in IBM"
So did I - IBM will not process a DSN with a leading space, an embedded space.
Expecting COBOL, irrespective of vendor, to discern your defect of a leading space ain't gonna happen
Last edit: Ralph Linkletter 2025-05-17
Hi
i', mot interest in polemics... you started a polemic with me i do not know why ...
please read carefully before accusing people ... read again what i wrote and what Simon answered.. the book does not reports that rm command will enclosse filename into
rm " xxxx ". this change the behaviour of command if instead using rm xxxx...
Last edit: Maurizio Bongini 2025-05-17
On 17/05/2025 20:34, Maurizio Bongini wrote:
I was not involved with this BUT the bug is with your program, not the
compiler and generated code.
Computers are not mind readers and can only work based on your programming.
As pointed out to you by another, you did not specify exactly the file
name in your ASSIGN.
So fix the coed error and rerun - joining the rest of us finding bugs in
our code :)
You indicated in your original email that this statement was a COBOL bug
"CALL 'CBL_DELETE_FILE' USING 'bMAG0050' where b is a space.
That program is defective. Period !
To change the discussion to a Linux operating CLI is your own windmill to tilt at.
I am done with this thread :-)
Are yo uaware that ..
In your first answer you offended me treating me like an idiot ?
So Keep your offenses for yourself !
STOP !
Next if you want change this on the book
... done using rm
to
....done using rm (with filename enclosed into double quotes)
Last edit: Maurizio Bongini 2025-05-18