.st0{fill:#FFFFFF;}

How to delete IFS files with bad malformed files names 

 November 11, 2010

By  NickLitten

Ever created an IFS file with a whacky file name?

As part of my testing routines for the new IBMi Data Distribution commands (DSTDTA and DSTSPLF) I was creating and testing all kinds of documents in the integrated File system. Taking any file from the good ole iSeries and converting it to TXT, PDF, XML, TIF, CSV and plopping a copy into the IFS or DLS, then sending it as a very saucy looking email to the users… It works beautifully now but “whats that got to do with malformed file names” I hear you mutter.

So, while I was writing these programs I had a brain-fart and accidentally create IFS objects with completely invalid file names… its possible to actually call a file ‘\this\is\a\file.txt‘ (with slashes as part of the file name) and as you can imagine Windows Explorer just completely gets its knickers in a twist. trying to figure out what folder that is in…

How to delete IFS files with bad malformed files names 1

So I have this file called ‘\projex\test.pdf’ and its stored in a folder called ‘/home/nlitten’

Not Good!

So lets go and do a WRKLNK to delete the file in question. No Joy. It tells me it cant delete it, because it cant find it… aaaargh!!!!

These problems happen because your program that is creating IFS files uses a ‘\’ when it should have used a ‘/’ (for internal IBMi IFS operations).

Running a RCLSTG wont help as these files aren’t damaged they’re just named badly. Neither will attacking it from within iSeries Navigator. It just seems to be stuck there… forever… eating up some storage.

So how do we delete malformed IFS documents?

It’s actually very easy — with IBMi’s super sexy and simple EDTF command.

If you use EDTF at a root level:


EDTF STMF(/)

you get a very basic screen showing every object in your IFS listing.

How to delete IFS files with bad malformed files names 2

Navigate to your folder containing the malformed files, select them with a 4 (or even simply ‘9’ the folder to recursively delete the lot) and press ENTER and Voila!

Dirty files are completed killed.

Very cool.

EDTF is like a 1980’s Bulletin Board version of SEU which works for any streamfile or even for flat files defined in libraries on the 400.

/me likey

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

I’m always looking for awesome input, feedback and critique!

>