Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Re: Portably transforming a string to a valid filename

by eg (Friar)
on Feb 20, 2001 at 02:53 UTC ( [id://59515]=note: print w/replies, xml ) Need Help??


in reply to Re: Portably transforming a string to a valid filename
in thread Portably transforming a string to a valid filename

You can just use pack to uuencode your file-name strings to be extremely file-system friendly (or, you can install linux or freebsd or something and get a friendlier file-system :)

To the original poster: don't do this. It's a waste of bandwidth (as well as a serious copyright violation.) Just /msg nate and ask him if he'll send you a copy of the database. He (probably) won't and you can move on to another project.

update ignore the last paragraph -- my misunderstanding. thought you planned on backing up the *entire* database. apologies all around.

update2 too bad E2's displaytype=xml doesn't show softlinks as well.

  • Comment on Re: Re: Portably transforming a string to a valid filename

Replies are listed 'Best First'.
Re: Re: Re: Portably transforming a string to a valid filename
by Anonymous Monk on Feb 20, 2001 at 03:03 UTC
    I think you misunderstand my intent; it's for a user to back up their own writeups. In fact, it won't work on another user unless you had their login and password, as it taps into E2's XML writeup displaytype, which requires that one be logged in as the user whose writeups are to be viewed.

      Let me stump again for my kind of solution (XML or no XML; flat file would work just as well). It would be easy enough to write a script that goes through the generated files and builds up a list of titles, or that spits out the node corresponding to a given title (this is beginning to sound like fun, actually!).

      I don't see that there's a significant benefit to storing each node in its own file anyway. Or perhaps you can explain why you want to do it this way?

      Philosophy can be made out of anything. Or less -- Jerry A. Fodor

        The method behind my madness, so to speak, was that a given user could then fairly easily translate the nodes to a group of html files, one to a topic -- if, for instance, one had written extensively about a topic and wanted to make the information available to those who don't use E2 or Google.The initial version (which, admittedly, isn't posted yet) allows one to use a regexp to select which writeups a given user wants to save from the database, which could apply equally well to a single-file mode.

        I was planning some sort of single-file functionality eventually, particularly so that one could pull out a group of nodes, revise them, and then auto-node them back into the database. I'm uncertain whether or not XML is the way to go, given I'm hardly an XML expert (or a Perl one, for that matter). Perhaps a single-XML-file option and a single-"text" file option.

        FWIW, an E2 user whose code I <strikeout>stole</strikeout> borrowed from (don't worry, it's GPL) to create it suggested the following regexp to me: $nodefilename =~ y,/:\\?'*&quot;&lt;&gt;;&amp;!\0,,d;
        , and I use a separate operation to translate spaces to underscores unless an option is selected that prevents this (for instance, if one is running Windows).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://59515]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found