search for: new_filenam

Displaying 20 results from an estimated 39 matches for "new_filenam".

Did you mean: new_filename
2016 Dec 07
0
[PATCH v3 2/6] v2v: ova: don't detect compressed disks, read the OVF instead
...ss filename [Unix.R_OK]; @@ -282,17 +289,16 @@ object (* The spec allows the file to be gzip-compressed, in which case * we must uncompress it into the tmpdir. *) - let filename = - if detect_file_type filename = `GZip then ( - let new_filename = tmpdir // String.random8 () ^ ".vmdk" in - let cmd = - sprintf "zcat %s > %s" (quote filename) (quote new_filename) in - if shell_command cmd <> 0 then - error (f_"error uncompressing %s, see earlier error...
2016 Nov 12
0
[PATCH v2 2/5] v2v: ova: don't detect compressed disks, read the OVF instead
...match xpath_string expr with + | None | Some "identity" -> false + | Some "gzip" -> true + | Some s -> error (f_"unsupported comprression in OVF: %s") s in + + let filename = if compressed then ( + let new_filename = tmpdir // String.random8 () ^ ".vmdk" in + let cmd = + sprintf "zcat %s > %s" (quote ovf_folder // filename) (quote new_filename) in + if shell_command cmd <> 0 then + error (f_"error uncompressing %s, see earlier...
2007 Aug 03
6
Problems saving an uploaded image to an app folder
...picture_file=(input_data) self.filename = input_data.original_filename self.content_type = input_data.content_type.chomp self.file_data = input_data.read end def write_to_disc #save the picture to newspipe/data/pictures with the name ''#{self.id}.extension'' new_filename = "#{self.id}.#{self.content_type.split("/").last}" if self.file_data.write("C:\\code\\InstantRails\\rails_apps\\newspipe\\data\\pictures\\data\\pictures\\#{new_filename}") return true else return false end end -- Posted via http://www.ruby-...
2016 Nov 21
2
Re: [PATCH v2 2/5] v2v: ova: don't detect compressed disks, read the OVF instead
...ror (f_"unsupported comprression in OVF: %s") s in Typo here, "compression". Also, the two "expr" and "compressed" let could be isolated in the "let filename" block. > + > + let filename = if compressed then ( > + let new_filename = tmpdir // String.random8 () ^ ".vmdk" in > + let cmd = > + sprintf "zcat %s > %s" (quote ovf_folder // filename) (quote new_filename) in > + if shell_command cmd <> 0 then > + error (f_"error uncompress...
2016 Nov 12
0
[PATCH v2 4/5] v2v: ova: don't extract files from OVA if it's not needed
...t;) disk mf mode disk actual mode disk expected; @@ -283,25 +389,50 @@ object | Some "gzip" -> true | Some s -> error (f_"unsupported comprression in OVF: %s") s in - let filename = if compressed then ( - let new_filename = tmpdir // String.random8 () ^ ".vmdk" in - let cmd = - sprintf "zcat %s > %s" (quote ovf_folder // filename) (quote new_filename) in - if shell_command cmd <> 0 then - error (f_"error uncompressing %s, see earlier...
2006 Jun 20
2
Problem with "can''t dump anonymous class Class"
...if File.exists?(self.file_path) File.delete(self.file_path) end end def file=(uploaded_file) @uploaded_file = uploaded_file self.file_path = sanitize_filename(@uploaded_file.original_filename) self.content_type = @uploaded_file.content_type end private def new_filename(file_name) idx = file_name.rindex "." self.name.gsub(/[^\w\.\_]/, ''_'') + file_name[idx, file_name.length - idx] end def sanitize_filename(file_name) File.expand_path("#{RAILS_ROOT}/public/documents/#{new_filename(file_name)}" ) end end c...
2016 Nov 12
9
[PATCH v2 0/5] Import directly from OVA tar archive if possible
This series is related to the problem of inefficient import of OVA files. The needed enhancements of QEMU were merged into the codebase and should be available in QEMU 2.8. From there we can use 'size' and 'offset' options in raw driver to tell QEMU to use only subset of a file as an image. The patch set is more or less complete. The only outstanding issue is the missing detection
2016 Nov 04
0
[PATCH 4/5] v2v: ova: don't extract files from OVA if it's not needed
...nsupported comprression in OVF: %s") s in - let filename = if compressed then ( + let filename, partial = if compressed then ( + if partial then + untar ~path:((subfolder ovf_folder exploded) // filename) + ova tmpdir; let new_filename = tmpdir // String.random8 () ^ ".vmdk" in let cmd = sprintf "zcat %s > %s" (quote ovf_folder // filename) (quote new_filename) in if shell_command cmd <> 0 then error (f_"error uncompressing %s, see earlier...
2006 Jun 19
3
can''t dump anonymous class Class
...troy if File.exists?(self.file_path) File.delete(self.file_path) end end def file=(uploaded_file) @uploaded_file = uploaded_file self.file_path = sanitize_filename(@uploaded_file.original_filename) self.content_type = @uploaded_file.content_type end private def new_filename(file_name) idx = file_name.rindex "." self.name.gsub(/[^\w\.\_]/, ''_'') + file_name[idx, file_name.length - idx] end def sanitize_filename(file_name) File.expand_path("#{RAILS_ROOT}/public/documents/#{new_filename(file_name)}") end end cla...
2016 Nov 21
2
Re: [PATCH v2 4/5] v2v: ova: don't extract files from OVA if it's not needed
...ode disk actual mode disk expected; > @@ -283,25 +389,50 @@ object > | Some "gzip" -> true > | Some s -> error (f_"unsupported comprression in OVF: %s") s in > > - let filename = if compressed then ( > - let new_filename = tmpdir // String.random8 () ^ ".vmdk" in > - let cmd = > - sprintf "zcat %s > %s" (quote ovf_folder // filename) (quote new_filename) in > - if shell_command cmd <> 0 then > - error (f_"error uncompress...
2017 Mar 13
0
[PATCH 2/2] v2v: -i ova: Factor out the OVF parsing into a separate module.
...ment"); + name_from_disk ova + | Some name -> name in - (* The spec allows the file to be gzip-compressed, in which case - * we must uncompress it into the tmpdir. - *) - let filename = - if compressed then ( - let new_filename = tmpdir // String.random8 () ^ ".vmdk" in - let cmd = - sprintf "zcat %s > %s" (quote filename) (quote new_filename) in - if shell_command cmd <> 0 then - error (f_"error uncompressing %s, see earlier error...
2016 Nov 04
10
[PATCH 0/5] Import directly from OVA tar archive if possible
This is still a draft, not ready for commit yet. But feedback is welcomed. This series is related to the problem of inefficient import of OVA files. The needed enhancements of QEMU was merged into the codebase and should be available in QEMU 2.8. From there we can use 'size' and 'offset' options in raw driver to tell QEMU to use only subset of a file as an image. The first three
2020 Apr 06
0
[v2v PATCH 2/2] Consolidate handling of temporary files/dirs
...href will be something @@ -132,9 +133,7 @@ class input_ova ova = object (* The spec allows the file to be gzip-compressed, in * which case we must uncompress it into a temporary. *) - let temp_dir = (open_guestfs ())#get_cachedir () in - let new_filename = Filename.temp_file ~temp_dir "ova" ".vmdk" in - unlink_on_exit new_filename; + let new_filename = Filename.temp_file ~temp_dir:cachedir "ova" ".vmdk" in let cmd = sprintf "zcat %s > %s" (quote file...
2020 Apr 15
0
[PATCH nbdkit 2/9] floppy, iso, split, ssh: Use new vector type to store lists of strings.
...R; static void split_unload (void) { - size_t i; - - for (i = 0; i < nr_files; ++i) - free (filenames[i]); - free (filenames); + string_vector_iter (&filenames, (void *) free); + free (filenames.ptr); } static int split_config (const char *key, const char *value) { - char **new_filenames; + char *s; if (strcmp (key, "file") == 0) { - new_filenames = realloc (filenames, (nr_files+1) * sizeof (char *)); - if (new_filenames == NULL) { - nbdkit_error ("malloc: %m"); + s = nbdkit_realpath (value); + if (s == NULL) + return -1; + if (s...
2020 Apr 06
0
[PATCH virt-v2v v2 2/2] v2v: Allow large temporary directory to be set on a global basis.
...+++ b/v2v/input_ova.ml @@ -132,8 +132,8 @@ class input_ova ova = object (* The spec allows the file to be gzip-compressed, in * which case we must uncompress it into a temporary. *) - let temp_dir = (open_guestfs ())#get_cachedir () in - let new_filename = Filename.temp_file ~temp_dir "ova" ".vmdk" in + let new_filename = + Filename.temp_file ~temp_dir:Utils.large_tmpdir "ova" ".vmdk" in unlink_on_exit new_filename; let cmd = sprintf "zcat %s &...
2017 Mar 13
4
[PATCH 0/2] v2v: -i ova: A couple of cleanup patches.
A couple of patches cleaning up the -i ova code. These are both just refactoring (or should be at any rate). The second patch is best viewed with 'git show -w' to exclude whitespace changes. Rich.
2020 Apr 06
4
[v2v PATCH 1/2] v2v: nbdkit: change base dir for nbdkit sockets/pidfiles
Since this new temporary directory will contain UNIX sockets for communicating with nbdkit, then its path must not be too long. Use the existing directory that libguestfs exposes for this, i.e. sockdir. --- v2v/nbdkit.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/v2v/nbdkit.ml b/v2v/nbdkit.ml index 65317f9b..46b20c9d 100644 --- a/v2v/nbdkit.ml +++ b/v2v/nbdkit.ml
2020 Apr 06
6
[PATCH virt-v2v v2 0/2] v2v: Large temporary directory handling.
v1 was here: https://www.redhat.com/archives/libguestfs/2020-April/msg00007.html There's a BZ for this now which I forgot to add to the commit message: https://bugzilla.redhat.com/show_bug.cgi?id=1814611 For v2: - Fix incorrect reference to $TMPDIR in existing manual. - Separate handling for small temporary files and large temporary files. Small temporary files go into $TMPDIR
2006 Jun 05
0
FXRuby: updating a text label/positioning question
...ould > that be done ? I didn''t follow all of that very well, but I think your question boils down to, "How do I change the text of a label?" If that''s the question, you change it using the text accessor method, e.g. @header.text = "Contents of file " + new_filename Note that you don''t have to create a new label every time, and in fact that''s sort-of a wasteful thing to do. Better to just change the text of the existing label widget (as shown here). P.S. Please consider subscribing to the fxruby-users mailing list and posting questions the...
2016 Dec 07
12
[PATCH v3 0/6] Import directly from OVA tar archive if possible
v3: Addressed Pino's comments, namely: - input_ova.ml - untar takes list of paths - renamed untar_partial to untar_metadata - replaced uggly regex with nsplit - tests - test changes are part of the main commit - renamed test-data/guestfs-hashsums.sh to test-data/test-utils.sh - renamed qemu_version to qemu_is_version and moved it to test-data/test-utils.sh - normalize paths