Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
kthomp24 Absent Member.
Absent Member.
1396 views

C$DELETE with Thin Client application OR user access to a folder?

We are looking at a process that will allow a user to write files to a local drive using a combination of:

1. C$OPENSAVEBOX (type 4) to select a folder to write the file

2. C$COPY to copy the file from the server to the local machine

The above works fine as long as the user has write access to the folder selected.  So we are attempting to check write access to a folder before we let the user "pick" that folder.  We are attempting the following:

1. C$OPENSAVEBOX (type 4) to pick a folder

2. C$COPY to copy a small test file to folder

3. If no Error is returned from C$COPY the user has the rights to that folder

4. C$DELETE to delete small test file from folder

This is where my question comes in...all items above work great except #4...the delete command will not remove the file.  The C$DELETE command returns 1 (error) every time it is ran.


Any help would be great with this or any different way for us to check user access to write to a folder would help also.

0 Likes
3 Replies
Micro Focus Expert
Micro Focus Expert

RE: C$DELETE with Thin Client application OR user access to a folder?

If this syntax ... C$DELETE "@[DISPLAY]:C:\path\filename" is failing, please report this bug to Customer Care

0 Likes
kthomp24 Absent Member.
Absent Member.

RE: C$DELETE with Thin Client application OR user access to a folder?

Below is the code from the program I described above...it is running from a UNIX server via thin client and only the C$DELETE statement fails:

      SELECT-SAVE-FOLDER.

          INITIALIZE WS-SAVE-FOLDER.

          INITIALIZE OPENSAVE-DATA.

          CALL "C$OPENSAVEBOX" USING 4 OPENSAVE-DATA.

          MOVE OPNSAV-FILENAME TO WS-SAVE-FOLDER.

          MOVE ZEROS TO WS-ERROR.

          MOVE SPACES TO WS-STRING.

          STRING "@[DISPLAY]:" DELIMITED BY SIZE

                 WS-SAVE-FOLDER DELIMITED BY "  "

                 "\" DELIMITED BY SIZE

                 "TEST.TXT" DELIMITED BY SIZE

                 INTO WS-STRING.

          CALL "C$COPY" USING

               "/u/acudir/dataC/DONOTREMOVE.txt"

               WS-STRING

               GIVING WS-ERROR.

          CANCEL "C$COPY".

          IF WS-ERROR = ZEROS

             CALL "C$DELETE" USING WS-STRING

                GIVING WS-ERROR

             CANCEL "C$DELETE"

             GO TO SSF-EXIT

          ELSE

             DISPLAY MESSAGE BOX

                "USER DOES NOT HAVE PERMISSION TO SAVE TO THIS FOLDER!"

                NEWLINE

                NEWLINE

                "PLEASE SELECT ANOTHER."

             GO TO SELECT-SAVE-FOLDER

          END-IF.

      SSF-EXIT.

          EXIT.

0 Likes
Micro Focus Expert
Micro Focus Expert

RE: C$DELETE with Thin Client application OR user access to a folder?

It does appear to be a bug. I know that  call "cbl_delete_dir"  works under thin client, so you can blow away the directory thus getting rid of the file but the C$DELETE should work as well and it doesn't.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.